POV-Ray : Newsgroups : povray.general : Spline vectors : Re: Spline vectors Server Time
2 Aug 2024 12:17:54 EDT (-0400)
  Re: Spline vectors  
From: Mike Williams
Date: 29 Oct 2004 01:23:10
Message: <C6TDhBAyDdgBFwNs@econym.demon.co.uk>
Wasn't it Shishberg who wrote:
>"Skip Talbot" <ski### [at] aolcom> wrote:
>> Is there a built in function that I'm overlooking that would allow me to
>> compute a normal and tangent vector to a given point on a spline?  I saw
>> that Chris Colefax's spline macro can do this but is there something I can
>> use with POV's built in splines?  I'm looking at approximating the vectors
>> by using adjacent points, but I was hoping there might be something a little
>> more accurate.
>>
>> Skip
>
>Would official support for this be too difficult? It would definitely extend
>the usefulness of built-in splines.

I somehow seem to have missed the beginning of this thread, so apologies
if this has been said already.

To find the normal you can do something like

#macro SplineNormal(Spline,C)
  vnormalize(Spline(C+0.00001)-Spline(C-0.00001))
#end

Finding the normals is a bit trickier because there are an infinite
number of normal vectors to a spline at any point.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.