POV-Ray : Newsgroups : povray.animations : camera-spline behaves weird : Re: camera-spline behaves weird Server Time
27 Sep 2024 18:17:53 EDT (-0400)
  Re: camera-spline behaves weird  
From: Mike Williams
Date: 14 Feb 2004 01:37:56
Message: <qSfiYGAQHcLAFwGN@econym.demon.co.uk>
Wasn't it Marc Roth who wrote:
>Hi everybody!
>i'm currently working on a scene with a car driving along a street, changing
>the lane and then turning left at a intersection. i tried using a
>quadratic_spline, cubic_spline and a natural_spline for the cam-movement but
>the problem is that all three of them don't produce an accpetable path
>across the intersection. it's not like a part of a circle but has some
>unneccessary movements to the left and the right in it (am i confusing you?
>sorry...). so basically i need to know how to create a spline that produces
>a path similar to a quarter of a circle.

Here's a spline that does a quarter circle turn

#declare MySpline = spline {
   natural_spline
    0,     <-1, 0, 0>,
    0.001, <-0.999, 0, 0>,
    0.5,   <-1+sin(pi/4),0,1-sin(pi/4)>,
    0.999, <0,0,0.999>,
    1,     < 0, 0, 1>
}

The second and fourth control point force the direction of the tangent
at the endpoint. The third control point stops it taking a shortcut.

Unfortunately, this may lose you some of the advantages of using a
spline, and you might as well drive along an actual circle.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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