POV-Ray : Newsgroups : povray.binaries.animations : Roller Coaster WIP 6 (MPEG1 Link: 4.7 MB) : Re: Roller Coaster WIP 6 (MPEG1 Link: 4.7 MB) Server Time
5 Jul 2024 10:51:44 EDT (-0400)
  Re: Roller Coaster WIP 6 (MPEG1 Link: 4.7 MB)  
From: DJ Wiza
Date: 2 May 2006 19:02:38
Message: <4457e50e$1@news.povray.org>
Tim Nikias wrote:
> I've once written a small script to create a mesh-tube running along a
> spline, and ran into similiar problems. What was suggested to me then by
> Rune and someone else who's name I've forgotten (sorry) to update the
> up-vector successively, instead of independantly for each frame (in my case,
> for every ring of the tube, in your case, it's the frames).
> 
> I start with the initial direction I'm heading to, and an initial up vector.
> On the next frame, use the old up-vector, and double vcross it with the new
> direction to get the new up-vector.
> 
>   #local Up = vnormalize(vcross(vcross(New_Direction,Last_Up),
> New_Direction));
> 
> Since the new direction and the old up-vector aren't perpendicular, you'll
> create a new up-vector that is aligned along the plane defined by the old
> up-vector and new-direction... Quite simple, once you think it through.
> 
> Additionally, since this only affects corkscrew or other loopings, you could
> create a parsing step that'll just do that when it's needed. Needs a little
> more though, but would be worthwhile in case you plan on distributing the
> render and making the animation independant of former frames.
> 
> Regards,
> Tim
> 

Hmm...If I understand you correctly, then what I'd be doing is starting 
with an up vector of simply y, double cross it with the new direction 
with each frame, and pass it to the next frame (Just like I pass the 
current location and speed with each frame).  On every frame, I'll do 
all my banking calculations based on that vector, rather than using y 
every time.

Correct?

-DJ


Post a reply to this message

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