// Persistence of Vision Ray Tracer Scene Description File // File: spline1.pov // Vers: 3.5 // Desc: This file illustrates using splines to animate an object // along a path defined by a spline. First the spline is created. We // then create a set of spheres along the spline so that we can // see the path. We then animate a cone along the spline path. // The transformation called Spline_Trans() found in the transforms.inc // file is used to orient the cone/spheres along the path. // Date: Nov 2002 // Auth: Jenny Orr // ==== POV-Ray Includes ==== #include "colors.inc" // Standard Color definitions #include "textures.inc" // Standard Texture definitions #include "transforms.inc" camera { location <0.0, 2.0, -10.0> look_at <0.0, 1.0, 0.0> } light_source { <100.0, 200.0, -15.0> // light's position (translated below) color rgb 2.0 // light's color } // The ground. plane { y, // unit surface normal, vector points "away from surface" -4.0 // distance from the origin in the direction of the surface normal pigment { Blue } } // Define the spline. #declare MySpline = spline { cubic_spline -.1, <-4,0,0> 0, <-3,0,0> .15, <-1,2,0> .3, <3,0,0> .45, <4,2,0> .6, <0,4,0> .75, <-3,3,0> .90, <-3,-3,0> 1.05, <0,-4,0> } // Draw spheres along spline path. #declare cnt = 0; #while ( cnt < 50) sphere { <0,0,0>, .2 pigment { rgb <.02*cnt,.5,.5> } Spline_Trans(MySpline, .02*cnt, z, 0.1, 0.1) } #declare cnt = cnt + 1; #end // Animate the cone along path cone { 1*y, 0.0, -1*y, 0.4 pigment { Green } Spline_Trans(MySpline, clock, y, 0.1, 0.5) }