POV-Ray : Newsgroups : povray.general : Direction on a spline : Re: Direction on a spline Server Time
4 Aug 2024 06:09:56 EDT (-0400)
  Re: Direction on a spline  
From: Jim Charter
Date: 14 Jul 2003 00:21:57
Message: <3f122fe5$1@news.povray.org>
gonzo wrote:
> Ok, this is probably really simple and I'm just overlooking something
> obvious....
> 
> I'm using a spline to create a path, and placing objects along the path with
> a loop. How do I get the object to face the direction of the spline though?
> If I use something like;
> 
>     object { My_Object translate Path(cntr) }
> 
> the object ends up in the right place, but still facing it's original
> direction, when I want it to face the direction of the path.  I tried using
> VAngleD( current_point, next_point ) to get a rotation angle and simply
> rotating the object by that but it didn't seem to do anything.
> 
> Can somebody post a simple example of how to do this for a trigonometrically
> impaired Pover?
> 
> RG
> 
> 
You use the Reorient_Trans macro from transforms.inc

Say the front of your object is facing -z
Off the top of my head :
your_object { ...
Reorient (  -z, your_spline ( count ) -  your_spline ( count - 1 ) )
translate your_spline ( count )
}
You get the idea?
-Jim


Post a reply to this message

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