POV-Ray : Newsgroups : povray.general : Need help figuring something out : Re: Need help figuring something out Server Time
1 Aug 2024 02:22:17 EDT (-0400)
  Re: Need help figuring something out  
From: DJ Wiza
Date: 1 May 2006 14:19:24
Message: <4456512c$1@news.povray.org>
Roman Reiner wrote:
> There's no perfect vertical loop with the characteristics you described
> because with a perfect loop the entrance end exit point would be at the
> same location. in the case of a "normal" loop the problems gets similar to
> the corkscrew problem (the banking angles may be very close to 0/180
> degrees but are not equal 0/180.

In theory, you're right.  However, No Limits is used by many amateurs 
who will use values of just 0 and 180 when making a loop.  Of course, 
this creates an oddly shaped loop that would be a bit uncomfortable to 
ride, but they do it because they don't know otherwise.

  > Apart from my suggestion (>180 degrees check) i think the problem 
could be
> solved by simply changing the interpolation method.
> imagine the perfect loop. in the first and the last quarter the banking is
> zero and at the point where the car points straight up/down the banking
> "jumpes" to 180 degree and back to zero respectivaly without any
> interpolation. the more the entrance and exit point move away of each other
> (the loop becomes a corkscew) the transition gets smoother and smoother
> until it gets linear in the other extrem case namely a straight line with a
> 360 degrees drill. maybe the amount of interpolation can be extracted by
> checking the distance of the entrace and exit point. this could require some
> math though ;)

Every bit of math I add makes a longer parsing time.  However, I 
recently made a HUGE optimization that cut the parse time of creating 
track ties immensely.  It allows the user to decide how accurate they 
want the positions of the track ties to be, and it steps along the 
beziers in steps based on that accuracy by dividing the requested 
precision by the estimated length of the bezier.  The length of the 
bezier is estimated by taking 100 steps along the bezier and adding up 
the distances between each step.

> Could surely work that way as well but it sounds more difficult than my
> suggestion IMHO. My version has the advantage that the interpolation needs
> work anyways. You could give both approachs a try though.

I just implemented my method.  It was actually extremely easy to 
implement.  Rather than taking a weighted average of two integers and 
creating a vector on that, I created two vectors, and created a weighted 
average of those.

It works.  The corkscrew problem works out, and loops work, but really 
tight loops (As in, very little lateral movement) have a slight glitch 
when it goes vertical.

I'm about to post the latest track to p.b.animations.  You'll see it there.

-DJ


Post a reply to this message

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