To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.rayOpen lugnet.cad.ray in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Ray-Tracing / 1283
1282  |  1284
Subject: 
Re: Tilting the camera
Newsgroups: 
lugnet.cad.ray
Date: 
Thu, 30 May 2002 00:19:20 GMT
Viewed: 
761 times
  
Anders Isaksson wrote:
I can imagine 'tilting' or 'slanting' both sideways and forwards/backwards.

ROLL, PITCH and YAW are unambiguous.

Imagine the camera sitting in the cockpit of a plane, looking forward, then

ROLL  - the rotation around the axis 'tail <--> nose'
PITCH - rotation around the axis 'right wing <--> left wing'
YAW   - rotation around the third axis (like turning your head)

Thanks, I guess it's ROLL then.

and CCW being the positive direction.

Hm, first vote for CCW. Why?

Your problems with the sky vector may be the fact that sky implies a ROLL
and this ROLL is applied _first_ to match the camera and the sky vector,
then look_at changes the YAW, and finally the PITCH (at least that's my
interpretation of the POV documentation).

I agree, see also http://www.spiritone.com/~english/cyclopedia/sky.html

Modifying both SKY and RIGHT seems to do the job for me:

#declare TiltAngle = 30
#declare CameraRoll = -TiltAngle*pi/180  // '-' to get CCW for positive
angles

sky      -y*cos(CameraRoll) - 4/3*x*sin(CameraRoll)
right    -4/3*x*cos(CameraRoll) - y*sin(CameraRoll)

Nope, sorry - it doesn't work if you look at the model from +x,
e.g. with -cg30,90
The solution must be to rotate (roll) the camera about the location-look_at vector
using translate/rotate/matrix at the end of the camera definition.
/Lars



Message has 2 Replies:
  Re: Tilting the camera
 
"Lars C. Hassing" <lch@ccieurope.com> skrev i meddelandet news:GwwDyB.Apu@lugnet.com... (...) Because my fingers slipped :-) CW == positive direction -- Anders Isaksson, Sweden BlockCAD: (2 URLs) (22 years ago, 30-May-02, to lugnet.cad.ray)
  Re: Tilting the camera
 
Lars C. Hassing wrote... (...) location L3Location sky -y right -4/3*x look_at L3LookAt translate -L3Location #declare vx=vaxis_rotate(x,L3...ollAngle); #declare vy=vaxis_rotate(y,L3...ollAngle); #declare vz=vaxis_rotate(z,L3...ollAngle); matrix (...) (22 years ago, 18-Jun-02, to lugnet.cad.ray)

Message is in Reply To:
  Re: Tilting the camera
 
"Lars C. Hassing" <lch@ccieurope.com> skrev i meddelandet news:Gwqr3t.L63@lugnet.com... (...) says: (...) I can imagine 'tilting' or 'slanting' both sideways and forwards/backwards. ROLL, PITCH and YAW are unambiguous. Imagine the camera sitting in (...) (22 years ago, 27-May-02, to lugnet.cad.ray)

9 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR