POV-Ray : Newsgroups : povray.advanced-users : Camera Navigation - Tilt and Pan Macro? : Re: Camera Navigation - Tilt and Pan Macro? Server Time
29 Jul 2024 16:34:00 EDT (-0400)
  Re: Camera Navigation - Tilt and Pan Macro?  
From: Redbeard
Date: 14 Nov 2001 21:15:51
Message: <3bf32557@news.povray.org>
"Daniel Matthews" <dan### [at] 3-enet> wrote in message
news:136### [at] 3-enet...
> Has anyone developed a macro for controlling a camera with "traditional"
> instructions? I am working on a project where I need to set up and store
> multiple views of a site. I use CASE to select a camera and I have a NSEW
> system for camera position and view direction, but no "tilt" or "pan".
>
> Any ideas?
>

These are simply rotations of the camera, correct?  You might try something like
this:

    1. Start with camera at origin facing z-direction with look_at and angle
already set using appropriately translated positions for position and view.  Or
by using direction and other camera settings.

    2. Use rotate <Tilt, Pan, 0>, where Tilt is negative for tilting up,
positive for down; and Pan is negative for left and positive for right.

    3. Translate back to the camera position.

The key here is step 2.  You just have to make sure that when you do your
rotation, the camera is at the origin.  Otherwise the whole camera will move and
most people get confused by this.

This probably isn't the best way, but it should work.

Michael

--
camera{location<8,20>look_at<6,0,4>}light_source{<8,8>rgb 1}difference{union{
#macro M(D,J)#local R=asc(substr(D,J,1))-32;<div(R,10)*2,mod(R,10)>#end#macro
E(D,B,R)prism{-D,4+D,R#local C=1;#while(C<R+1)M(B,C)#local C=C+1;#end}#end E(
0," (2:FPKAD80* U_dZU"18)sphere{2,2}#macro T(N)cylinder{<9,-N,3><9,4+N,3>3-N}
#end T(0)}T(2)E(1"45LNXUK4"8)pigment{rgb x+y/2}}//(c)2001 MDJohnson(Redbeard)


Post a reply to this message

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