POV-Ray : Newsgroups : povray.advanced-users : focal_point with camera transform? : Re: focal_point with camera transform? Server Time
29 Jun 2024 03:37:53 EDT (-0400)
  Re: focal_point with camera transform?  
From: Alain
Date: 10 Nov 2013 18:27:37
Message: <52801669$1@news.povray.org>

>
>> Workaroud:
>> Using the vtransform() macro, apply your transform/matrix to the parts
>> of the camera that you want to affect, like location and look_at.
>
>
> Could you please show me an example on how to do this?  I am not following what
> you are saying...
>
>

#include "transforms.inc"
.
.
.
camera {
// Apply the transformation directly to the location

location vtransform(<0,0,0>,  matrix<1,0,0,0,1,0.1,0,-0.1,1,0,-1.75,-12> 
inverse )

perspective // defult
// Need to apply to the direction vector to keep it consistent

  direction vtransform(<0,0,-1>, 
matrix<1,0,0,0,1,0.1,0,-0.1,1,0,-1.75,-12> inverse )

  angle 60
// and to the look_at location

look_at vtransform(<0,0,-1>,  matrix<1,0,0,0,1,0.1,0,-0.1,1,0,-1.75,-12> 
inverse )

// the transform is removed from here

  focal_point <0.0,3.5,1>
         aperture 0.5
         blur_samples 100
         confidence .9
         variance 1/10000
}

***OR***

#include "transforms.inc"
.
.
.
camera {
location vinv_transform(<0,0,0>, 
matrix<1,0,0,0,1,0.1,0,-0.1,1,0,-1.75,-12> )
perspective
  direction vinv_transform(<0,0,-1>, 
matrix<1,0,0,0,1,0.1,0,-0.1,1,0,-1.75,-12> )
  angle 60
look_at vinv_transform(<0,0,-1>, 
matrix<1,0,0,0,1,0.1,0,-0.1,1,0,-1.75,-12> )

  focal_point <0.0,3.5,1>
         aperture 0.5
         blur_samples 100
         confidence .9
         variance 1/10000
}


The second example use a macro that is designed to inverse the 
transformation provided, so, it don't need to be explicitely inverted.

Both macros take 2 parameters:
1 - The vector to be transformed.
2 - The transformation to be applyed.



Alain


Post a reply to this message

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