POV-Ray : Newsgroups : povray.newusers : Smooth circular rotation using spline : Re: Smooth circular rotation using spline Server Time
25 Apr 2024 02:27:46 EDT (-0400)
  Re: Smooth circular rotation using spline  
From: Alain
Date: 25 Oct 2016 11:56:21
Message: <580f80a5$1@news.povray.org>

> Hi all,
>
> I'm trying to make my camera rotate around an object in a perfectly smooth
> circular manner. The reason I'm having
> trouble is that I want the camera to be slow in some parts sections of the
> rotation while fast in other parts. I'm no math whizz so I an using the spline
> identifiers rather than some complicated trigonometry code. Cubic_spline seems
> to work closest (smoothest) to what I want it to do.
>
> Ive used a total of 12 points per rotation so far and the camera still
> appears to 'wobble' in
> and out toward the centre object. See the code below for the camera path. Is
> there an easier way to make the path a smooth circle than just to keep adding in
> points on the curve? It gets
> tricky splitting the rotation time up into the correct proportions as you add in
> more points.
>
> Any suggestions are welcome!
>

Don't use a spline.
As your camera is orbiting around the origin, you can simply place it at 
the start position and rotate it using rotate y*Angle.
Now, the only trick is to controll the speed of the camera. For that, 
it's possible to use a spline where you set the angular location 
according to your time frame.
It's also possible to use some function for that task, like sin(Time)+1
The +1 is there to keep the camera moving forward, otherwise, it will 
ossilate.

Sample camera:
camera{
  location <0, 4000,-5000>
  look_at <0, 2000, 0>
  rotate y*(clock*360 + sin(clock))
}


Post a reply to this message

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