POV-Ray : Newsgroups : povray.advanced-users : Retrieving Camera Pose Server Time
23 Dec 2024 12:32:35 EST (-0500)
  Retrieving Camera Pose (Message 1 to 3 of 3)  
From: handos
Subject: Retrieving Camera Pose
Date: 11 Jan 2011 10:55:00
Message: <web.4d2c7cf962a017d54c79ec70@news.povray.org>
Hi everyone,

I'd like to get the pose of camera looking at the scene. e.g. in my case it is

#declare cl = <0,0,-165>;
camera{

 location cl
 up y*1.8
 right x*3.6
 direction 2.8*z
 look_at <0,0,0>
 translate 400*y
 translate<tx,ty,tz>
 rotate <rx,ry,rz>
 translate <10,5,150>

}
and the povray file is called with
megapov + "Declare=tx=-125.881" + "Declare=ty=-21.4282" + "Declare=tz=-22.9708"+
"Declare=rx=18.7804" + "Declare=ry=-30.3326" + "Declare=rz=-32.1209"

I'm rendering the office.pov scene available in povray hall of fame and found a
software called vlpov (http://www.vlfeat.org/~vedaldi/code/vlpovy.html) which
returns the camera parameters as

output_name   = 'scene_-125.880806_-21.428187_-22.970766.png' ;
screen_height = 480 ;
screen_width  = 640 ;
cam_type      = 'perspective' ;
cam_pos       = [  164.7199   402.5147   38.02027]' ;
cam_dir       = [ -1.613141 -0.05161951   2.288037]' ;
cam_up        = [ 0.8776798   2.131886  0.6668896]' ;
cam_right     = [  2.631566  -1.652116   1.818068]' ;
cam_sky       = [         0          1          0]' ;
cam_lookat    = [         0          0          0]' ;
cam_fpoint    = [         0          0          1]' ;
cam_focal     =     2.8 ;
cam_angle     =      90 ;

All that bothers me is that why is it still looking at <0,0,0> after it has been
translated, rotated and again translated. Is there any way to verify if this
pose retuned by vlpov is correct or not? Or is there any other way to retrieve
the camera pose without using vlpov? Could someone please kindly have a look at
this and help me out! I'd be very grateful.

Kind Regards,
Ankur


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Retrieving Camera Pose
Date: 12 Jan 2011 03:54:23
Message: <4d2d6c3f@news.povray.org>
Hi Ankur:

   I'm not sure that vlpov ouput info is what you think it is... seems to
me that it is not computing all the transformations to update the
look_at info. But there is a of course a way to verify: place something
at <0,0,0>, for example a red sphere, and see if the ouput image has
this object centered on it.

   Btw, your work will be much easier if you first rotate the camera and
then translate it... and also if you get ride of the other fixed
translations:


#declare cl =<0,0,-165>;
camera{
   location cl
   up y*1.8
   right x*3.6
   direction 2.8*z
   look_at<0,0,0>
   rotate<rx,ry,rz>
   translate<tx,ty,tz>
}

   Now, you can calculate the new location and loot_at by using the
function vrotate() and adding the translations.

   You can also do he opposite: calculate first the new location and
look_at based on the transformation parameters, and then use these on
the camera definition.

   Regards,


-- 
Jaime Vives Piqueres
		
La Persistencia de la Ignorancia
http://www.ignorancia.org



> Hi everyone,
>
> I'd like to get the pose of camera looking at the scene. e.g. in my
> case it is
>
> #declare cl =<0,0,-165>; camera{
>
> location cl up y*1.8 right x*3.6 direction 2.8*z look_at<0,0,0>
> translate 400*y translate<tx,ty,tz> rotate<rx,ry,rz>
> translate<10,5,150>
>
> } and the povray file is called with megapov + "Declare=tx=-125.881"
> + "Declare=ty=-21.4282" + "Declare=tz=-22.9708"+ "Declare=rx=18.7804"
> + "Declare=ry=-30.3326" + "Declare=rz=-32.1209"
>
> I'm rendering the office.pov scene available in povray hall of fame
> and found a software called vlpov
> (http://www.vlfeat.org/~vedaldi/code/vlpovy.html) which returns the
> camera parameters as
>
> output_name   = 'scene_-125.880806_-21.428187_-22.970766.png' ;
> screen_height = 480 ; screen_width  = 640 ; cam_type      =
> 'perspective' ; cam_pos       = [  164.7199   402.5147   38.02027]'
> ; cam_dir       = [ -1.613141 -0.05161951   2.288037]' ; cam_up
> = [ 0.8776798   2.131886  0.6668896]' ; cam_right     = [  2.631566
> -1.652116   1.818068]' ; cam_sky       = [         0          1
> 0]' ; cam_lookat    = [         0          0          0]' ;
> cam_fpoint    = [         0          0          1]' ; cam_focal     =
> 2.8 ; cam_angle     =      90 ;
>
> All that bothers me is that why is it still looking at<0,0,0>  after
> it has been translated, rotated and again translated. Is there any
> way to verify if this pose retuned by vlpov is correct or not? Or is
> there any other way to retrieve the camera pose without using vlpov?
> Could someone please kindly have a look at this and help me out! I'd
> be very grateful.
>
> Kind Regards, Ankur
>
>
>
>
>
>
>


Post a reply to this message

From: SharkD
Subject: Re: Retrieving Camera Pose
Date: 20 Jan 2011 17:54:42
Message: <4d38bd32@news.povray.org>
On 1/12/2011 3:54 AM, Jaime Vives Piqueres wrote:
> Hi Ankur:
>
> I'm not sure that vlpov ouput info is what you think it is... seems to
> me that it is not computing all the transformations to update the
> look_at info. But there is a of course a way to verify: place something
> at <0,0,0>, for example a red sphere, and see if the ouput image has
> this object centered on it.


I find that omitting the look_at and angle statements entirely and 
relying instead on direction, up and right is a lot easier if you know 
you'll have to come back and apply transformations to the camera later.


Post a reply to this message

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