POV-Ray : Newsgroups : povray.general : Transform Look_At? Server Time
20 Nov 2024 12:39:12 EST (-0500)
  Transform Look_At? (Message 1 to 4 of 4)  
From: Bill DeWitt
Subject: Transform Look_At?
Date: 30 Sep 2001 14:36:26
Message: <3bb7662a$1@news.povray.org>
I have always used direct calculations to position my camera_location
and look_at but to adapt something I already have, I want to use a
transform. But transform doesn't work in a camera_location statement, nor in
a look_at. I can move the camera with the transform, but I want the camera
look_at to move with a slightly different transform. How would I do that?


Post a reply to this message

From: Warp
Subject: Re: Transform Look_At?
Date: 30 Sep 2001 15:03:28
Message: <3bb76c80@news.povray.org>
Bill DeWitt <bde### [at] cflrrcom> wrote:
:     I have always used direct calculations to position my camera_location
: and look_at but to adapt something I already have, I want to use a
: transform. But transform doesn't work in a camera_location statement, nor in
: a look_at. I can move the camera with the transform, but I want the camera
: look_at to move with a slightly different transform. How would I do that?

camera
{ location vtransform(initial_camera_location, location_transform)
  look_at vtransform(initial_camera_look_at, look_at_transform)
}

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Transform Look_At?
Date: 30 Sep 2001 18:13:35
Message: <3BB798F5.9BF7EB8C@hotmail.com>
Warp wrote:
> 
> Bill DeWitt <bde### [at] cflrrcom> wrote:
> :     I have always used direct calculations to position my camera_location
> : and look_at but to adapt something I already have, I want to use a
> : transform. But transform doesn't work in a camera_location statement, nor in
> : a look_at. I can move the camera with the transform, but I want the camera
> : look_at to move with a slightly different transform. How would I do that?
> 
> camera
> { location vtransform(initial_camera_location, location_transform)
>   look_at vtransform(initial_camera_look_at, look_at_transform)
> }

Just remember to add this first:

#include "functions.inc"

vtransform() is a macro defined
within that include file.


If you wan't to do it all yourself,
then you can do it like this:

// vL is the initial camera location vector
// vLA is the initial camera look_at vector

#declare OneTransform = transform { rotate 45*y }
#declare L_fn = function { transform { OneTransform } }
#declare LA_fn = function { transform { OneTransform translate 3*y } }

camera {
  location L_fn(vL.x, vL.y, vL.z) 
  look_at LA_fn(vLA.x, vLA.y, vLA.z) 
}


Tor Olav


Post a reply to this message

From: Bill DeWitt
Subject: Re: Transform Look_At?
Date: 30 Sep 2001 18:29:15
Message: <3bb79cbb@news.povray.org>
"Tor Olav Kristensen" <tor### [at] hotmailcom> wrote :
>
>
> If you wan't to do it all yourself,
> then you can do it like this:

    Thanks, but I just finished redeveloping the whole thing to use vectors
in the camera. I will learn your method anyway though...


Post a reply to this message

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