POV-Ray : Newsgroups : povray.newusers : Rollercoaster type maths (not possible in povray?) : Re: Rollercoaster type maths (not possible in povray?) Server Time
29 Jul 2024 10:17:27 EDT (-0400)
  Re: Rollercoaster type maths (not possible in povray?)  
From: Urs Holzer
Date: 7 Aug 2006 13:45:02
Message: <44d77c1e@news.povray.org>
CdeathJd wrote:
> [...]
> I have no idea how to grab the x,y,z value from the camera, or the
> spline. I failed here in basic aswell, but cant really explain why,
> and that wasnt using splines at all.
> 
> I tried doing this in the camera statement:
>       Spline_Trans (MySpline, clock-1, y, 0.85, 0.85)
>       //translate <50, 42.5, -212>
>       #declare ythen=y;
>       Spline_Trans (MySpline, clock, y, 0.85, 0.85)
>       #declare ynow=y;
> 
> it didnt error, but the camera then went far to the left of the track,
> even if by chance, the "ythen" and "ynow" values worked, and the view
> didnt shift to the left, i still wouldn't know what to do next. Its a
> shame it doesnt work more like other programming languages! Then it
> would have been easier :S

OK, I'll try to help you.  Try the following:

If you already have declared a spline (called Track here), you can alway
obtain a point from it at a given time by insetring

  Track(time)

So, if you want to know, where you are in this frame, simply take the
clock as time.

  Track(clock)

gives you the point where you are. If you want to find out, in which
direction you have to look, simply get The position on the track a
second later:

  Track(clock+1)

So you first have to declare the spline Track. Afterwards, you can add
the camera to your scene.

  camera {
    location Track(clock)
    look_at Track(clock+1)
  }

You can of course also use Spline_Trans. This would look like

  camera {
    location <0,0,0>
    look_at <0,0,1>
    Spline_Tans(Track, clock, y, 0.85, 0.85)
  }

One call of Spline_Trans does actually exactly what I discribed: It
computes the location using the clock as time and another point using
clock+0.85.

Note on the camera: You can position and align a camera wich the
location and look_at. But can also rotate and translate a camera
afterwards by using rotate and translate.

If you need more help, just ask.

(If you not already have done so, take a look at the following sections
in the doc: 2.2.1.9, 2.7.18 (I'm referring to the online documentation
http://www.povray.org/documentation/))

Greetings
Urs


Post a reply to this message

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