POV-Ray : Newsgroups : povray.general : Rotating an object so it is tangent to a spline. : Re: Rotating an object so it is tangent to a spline. Server Time
29 Jul 2024 10:18:25 EDT (-0400)
  Re: Rotating an object so it is tangent to a spline.  
From: Le Forgeron
Date: 13 Oct 2011 14:13:24
Message: <4e972a44@news.povray.org>
Le 13/10/2011 16:52, D103 nous fit lire :
> Hello,
> I am making a very basic test animation of a cannon shell being fired from a
> gun.
> After a bit of fiddling around, I have sorted out the path of the shell, and can
> do pretty much anything I want with it.
> 
> However I have not figured out how to rotate it so that it is always tangent to
> it's path.
> 
> I have written another "still" scene where the path is defined by a spline, but
> the
> closest I could get to a tangent was this:

what about creating the cylinder at the right position & orientation
first ? (instead of creating it and moving it)

tangent to spline Path1 at P is something like looking at P+epsilon.

#local CurPoint=Path1(P);
#local Soon=Path1(P+epsilon);
cylinder { CurPoint+50*vnormalize(Soon-CurPoint),
           CurPoint+50*vnormalize(CurPoint-Soon), 1
...

(assuming you want the center of cylinder on spline)


Post a reply to this message

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