POV-Ray : Newsgroups : povray.animations : Train : Re: Train Server Time
12 May 2024 02:34:13 EDT (-0400)
  Re: Train  
From: Chris B
Date: 19 Jul 2008 06:50:31
Message: <4881c6f7@news.povray.org>
"HelveticaFanatic" <nomail@nomail> wrote in message 
news:web.4881a898729c10115f60ef1e0@news.povray.org...
> "HelveticaFanatic" <nomail@nomail> wrote:
>> How can I make an animation of a train that follows curves and elevation? 
>> Is
>> there anyway to lay track on it, either?
>>
> I coded this and got a tunnel:
> ....
> #declare Train_Path = spline {
> cubic_spline
> -2, <0, 0, -10>,
> -1, <0, 0, -5>,
> 0, <0, 0, 0>,
> 250, <0, 0, 250>,
> 300, <30, 0, 290>,
> 350, <60, 0, 330>,
> 600, <60, 0, 580>,
> 601, <60, 0, 590>,
> 602, <60, 0, 600>
> }
>
> But it's a very sad tunnel:
>
> http://www.flickr.com/photos/helveticafanatic/2681282339/
>
> What is wrong? Do I need more keypoints or something?
>

I suspect you wanted a shape a bit more like in the example below. I think 
the problem was mainly that you were using very small increments at the 
start and end of your spline and large increments in the middle. I find it 
best to use a more uniform distribution of points along the curve.

>
> In tunnel planning, though, I should draw it on graph paper and find the 
> key
> points, right?
>

It's easier to use a spline editor or a vector graphics program than doing 
it on paper.


camera{location 2000*y look_at 0}
light_source{<1,100,-30> rgb 1}

#declare Train_Path = spline {
 cubic_spline
 -20, <0, 0, -10>,
 -10, <0, 0, -5>,
 0, <0, 0, 0>,
 250, <0, 0, 250>,
 300, <30, 0, 290>,
 350, <60, 0, 330>,
 600, <60, 0, 580>,
 610, <60, 0, 590>,
 620, <60, 0, 600>
}

sphere_sweep {
  cubic_spline
  605,
  #local I = -2;
  #while (I<603)
    Train_Path(I),10
    #local I = I + 1;
  #end
  texture {pigment {rgb <1,0,0>} finish {ambient 1}}
}


Post a reply to this message

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