POV-Ray : Newsgroups : povray.general : Need help figuring something out : Re: Need help figuring something out Server Time
1 Aug 2024 02:18:12 EDT (-0400)
  Re: Need help figuring something out  
From: Roman Reiner
Date: 30 Apr 2006 04:35:01
Message: <web.445475acfd5b7a09e7dcb31e0@news.povray.org>
Me again.

I thought about your problem and i'd like to make a suggestion how the
problem could possibly be solved (and as i guess it is handled in no
limits).

First of all. Yes a loop and a corkscrew is basically the same thing.

From what i read you are interpolating the banking between values that are
given at specific points. let's look at the last quarter of a loop. as you
wrote the banking goes from 270 to 0 by making 270-270=0. As it went from 0
to 270 during the first three quaters its roling back and gives that
distortion you're facing with.
Instead the banking should go from 270 to 0 by doing 270+90=360=0.

If you calculate the banking between two control points i would at first
check if any angle is negative. if so add 360 until it's positive.
afterwards mod(x,360) all the angles. Now they should all be in the range 0
to 360 degrees.
now calculate the (absolute) angle between the two controlpoints (second
minus first). if that is bigger than 180 degrees use the inverse angle
(360-angle).
In our example (270 to 0) it would calculate abs(0-270)=270>180 and
therefore use 360-abs(0-270)=90 instead and 270+90=360=0 leads to the
correct
handling.

Another example would be 90 --> 280. Here It goes abs(280-90)=190>180 ==>
360-abs(280-90)=170.

You said no limits wont allow you to use banking values greater than 270 but
i guess it's basically doing the same thing as i suggested above. My
algorithm is untested and may contain errors but this is how it should do
basically.

If you can give a hint which method/function you're using to interpolate the
values between the controlpoints i could propably suggest a smoother method.
Maybe not :)

Hope that helps
Regards Roman


Post a reply to this message

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