POV-Ray : Newsgroups : povray.newusers : Camera position for spline object : Re: Camera position for spline object Server Time
20 Apr 2024 10:05:19 EDT (-0400)
  Re: Camera position for spline object  
From: Kenneth
Date: 23 May 2022 04:30:00
Message: <web.628b448cc53419752eadabda6e066e29@news.povray.org>
Take a look at the 'Spline_Trans' macro in POV-ray's transforms.inc file, and
the example camera scene called 'splinefollow.pov' in
scenes/animations/splinefollow.

The idea is that you pre-#declare your spline, stick that into the Spline_Trans
macro, then use the macro as your animated camera position. (No need to make an
actual spline object.) Here is the example as given in the 'splinefollow.pov'
scene file...

camera {
      location 0
      look_at z
      translate <0,0.4,0.4> // [probably optional]
      Spline_Trans (MySpline, clock*11, y, 0.5, 0.5)
   }

By the way, a spline's 'index list' is not confined to the range of 0.0-1.0
(although that's very convenient when using the 'clock' value for the animated
camera movement.)  For some scenes, I like to use frame_numbers for my spline
points instead, as it is more intuitive for me. For example, running a 200-frame
animation...

spline{
.....
1, <...>
37, <...>
135, <...>
200, <...>
}

Then the Spline_Trans macro would be used like this:
Spline_Trans (MySpline, frame_number, y, 0.5, 0.5)


Post a reply to this message

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