POV-Ray : Newsgroups : povray.newusers : Semi-advanced camera positioning Server Time
5 Nov 2024 05:25:20 EST (-0500)
  Semi-advanced camera positioning (Message 1 to 2 of 2)  
From: Tyler Eaves
Subject: Semi-advanced camera positioning
Date: 30 Nov 2001 22:15:55
Message: <3c084b6b$2@news.povray.org>
I have 3 points, p1,p2,p3

p1 = Camera location
p2 = Camera look_at
p3 = 1 unit above camera location, relative to desired orientation of camera

To restate, if the camera was straight and level at the origin, looking
along +z, the values would be.

p1 = <0,0,0>
p2 = <0,0,1>
p3 = <0,1,0>

However, these 3 points are going through some rather complex rotations, and
I need to figure out how to 'lock' the camera into it.


Post a reply to this message

From: Chris Colefax
Subject: Re: Semi-advanced camera positioning
Date: 30 Nov 2001 22:51:33
Message: <3c0853c5@news.povray.org>
Tyler Eaves <tyl### [at] coastergamesnet> wrote:
> I have 3 points, p1,p2,p3
>
> p1 = Camera location
> p2 = Camera look_at
> p3 = 1 unit above camera location, relative to desired orientation of
camera
>
> To restate, if the camera was straight and level at the origin, looking
> along +z, the values would be.
>
> p1 = <0,0,0>
> p2 = <0,0,1>
> p3 = <0,1,0>
>
> However, these 3 points are going through some rather complex rotations,
and
> I need to figure out how to 'lock' the camera into it.

You can transform POV-Ray's camera just like any object, e.g.:

camera {location <0 ,0, 0> look_at  <0, 0, 1>
    rotate z*30 // Roll around viewing axis
    rotate <35, 135, 0> // Tilt and pan
    translate -x*20 rotate y*clock*360 // spin around y-axis
    }

When you use rotate and translate commands like this, POV-Ray keeps the
three camera vectors (direction, right and up) orthogonal, so the camera
view is not distorted.


Post a reply to this message

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