POV-Ray : Newsgroups : povray.animations : Camera Spline Woes Server Time
18 Jun 2024 08:22:01 EDT (-0400)
  Camera Spline Woes (Message 1 to 3 of 3)  
From:
Subject: Camera Spline Woes
Date: 6 May 2004 22:10:00
Message: <web.409aef27a6f410d525955f790@news.povray.org>
Hey all,

You may slightly remember me from a problem I posted about a while back
(media troubles). I'm baack. :) Let's see if Bob Hughes can crack *this*
one. :)

Now I am attempting to create a single file to take care of one whole
section of a scene (usually I create a new file for each frame...with my
methods, it's much simpler that way). To do so, I'm going to need something
on the order of 73 splines. I expect that creating the file will take me a
nice long time and will just about double my bald spot.

So, the first spline (the one I'm working on now) is for the camera. The
camera goes from it's starting position, moves -z for just a bit, and then
starts following a circle path. This it does beautifully. Here's the
problem.

While the other 72 splines are doing their thing (over a period of 8.15
seconds, 163 frames), the camera will be panning in this circle around the
set - continually focused at dead center (which just happens to be 0).
That's where things go awry. At the beginning of the render it starts out
pointing at 0. But it never shifts focus when it starts moving around the
circle. It keeps pointing in the -z direction, which is decidedly NOT what
I want it to do (gives away all the secrets!). However, I'm not an expert
POV user and I've racked my brain over and over on this. I can't figure out
why in the Milky Way this thing is acting like it is. Thus, you see me now.
You did a bang-up job on my last problem and I hope you can do the same
here.

I'm experienced enough to know that you'll want code. :)

My spline:

#declare CameraSpline =
 spline {
   quadratic_spline
   1, <22,-240,480>
   2, <-18,-240,330>
   3, <-238,-240,180>
   4, <-185,-240,-224>
   5, <16,-240,-313>
   6, <240,-240,-227>
   7, <339,-240,14>
   8, <253,-240,228>
   9, <17,-240,347>
   10, <-217,-240,236>
 }

Camera:

camera {
 #declare PCT = 5; // Percentage further away

 location vaxis_rotate(<0,0,0> + PCT/100.0*<7,-343,480>,
                       <-2401,-230449,-164640>,0) //<22,-240,480>
 sky      -y
 right    -4/3*x
 angle    67.3801  // not sure what this is for, was there at the beginning
 rotate   <0,1e-5,0> // Prevent gap between adjecent quads
 //Spline_Trans (CameraSpline, clock, -y, 0, 0)  /* not used - not sure if
it's the right thing */
 translate CameraSpline(clock)
 look_at <0,0,0> // <15,103,0> // -cla
}

I think that's all you will need. I did have to use transforms.inc - just
fyi. If you need anything else, please don't hesitate to ask!!

Thanks so much for any help you can furnish. You'll get credits for this one
for sure!!

-Mike Thorn
Novice raytracer
Owning a computer has its advantages - I can do the car and my head at the
same time.


Post a reply to this message

From: Mike Williams
Subject: Re: Camera Spline Woes
Date: 6 May 2004 23:22:38
Message: <+mmj3DA9CwmAFwOw@econym.demon.co.uk>


>While the other 72 splines are doing their thing (over a period of 8.15
>seconds, 163 frames), the camera will be panning in this circle around the
>set - continually focused at dead center (which just happens to be 0).
>That's where things go awry. At the beginning of the render it starts out
>pointing at 0. But it never shifts focus when it starts moving around the
>circle. It keeps pointing in the -z direction, which is decidedly NOT what
>I want it to do (gives away all the secrets!). However, I'm not an expert
>POV user and I've racked my brain over and over on this. I can't figure out
>why in the Milky Way this thing is acting like it is. Thus, you see me now.
>You did a bang-up job on my last problem and I hope you can do the same
>here.

I believe that there's something magic about using translate() on a
camera. I think it always gets implemented after everything else,
irrespective of where you position it. I don't know why. The camera
looks at <0,0,0> and *then* gets shifted sideways. The look_at point is
changed by the implementation of the translation.

A workaround is to remove the translate() command and just add
CameraSpline(clock) to the location calculation.


  location vaxis_rotate(<0,0,0> + PCT/100.0*<7,-343,480>,
                        <-2401,-230449,-164640>,0)
                        + CameraSpline(clock)


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Hughes, B 
Subject: Re: Camera Spline Woes
Date: 7 May 2004 00:11:40
Message: <409b0c7c$1@news.povray.org>

message news:web.409aef27a6f410d525955f790@news.povray.org...
>
> Let's see if Bob Hughes can crack *this* one. :)

Oh no! I can't handle challenges! Ha ha!

> While the other 72 splines are doing their thing (over a period of 8.15
> seconds, 163 frames), the camera will be panning in this circle around the
> set - continually focused at dead center (which just happens to be 0).
> That's where things go awry. At the beginning of the render it starts out
> pointing at 0. But it never shifts focus when it starts moving around the
> circle. It keeps pointing in the -z direction, which is decidedly NOT what
> I want it to do

Oh, I see Mike Williams has responded with what appears to be the solution.
I can understand the confusion since look_at might be thought of as working
like spotlight point_at where you can scale, translate, rotate the
light_source and it'll follow the transformation. I only vaguely recall the
inner workings being discussed and apparently it was deemed that all those
camera items remain static settings, unaffected by transformations (look_at
means "look at first and forevermore based on location"). I'm not certain of
the exact reasons or if this is really true. Guessing it'd be called
"locking in" the parameters so that they work upon each other in a nice
manner (internally). But don't ask me about it, I'm only an end-user too.
;-)
I was going to ask if you used a clock of 1 to 10 to go with that spline,
but after having tried the script it looks workable in the way Mike said. Oh
yeah, and angle 67.3801 is an equivalence to the default viewing area.
:-)

> #declare CameraSpline =
>  spline {
>    quadratic_spline
>    1, <22,-240,480>
>    2, <-18,-240,330>
>    3, <-238,-240,180>
>    4, <-185,-240,-224>
>    5, <16,-240,-313>
>    6, <240,-240,-227>
>    7, <339,-240,14>
>    8, <253,-240,228>
>    9, <17,-240,347>
>    10, <-217,-240,236>
>  }
>
> Camera:
>
> camera {
>  #declare PCT = 5; // Percentage further away
>
>  location vaxis_rotate(<0,0,0> + PCT/100.0*<7,-343,480>,
>                        <-2401,-230449,-164640>,0) //<22,-240,480>
>  sky      -y
>  right    -4/3*x
>  angle    67.3801  // not sure what this is for, was there at the
beginning
>  rotate   <0,1e-5,0> // Prevent gap between adjecent quads
>  //Spline_Trans (CameraSpline, clock, -y, 0, 0)  /* not used - not sure if
> it's the right thing */
>  translate CameraSpline(clock)
>  look_at <0,0,0> // <15,103,0> // -cla
> }


Post a reply to this message

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