POV-Ray : Newsgroups : povray.advanced-users : focal_point with camera transform? Server Time
2 Jun 2024 03:25:58 EDT (-0400)
  focal_point with camera transform? (Message 11 to 13 of 13)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Andy
Subject: Re: focal_point with camera transform?
Date: 10 Nov 2013 18:10:01
Message: <web.528011459915e2734dc349de0@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.

Nevermind.. i think i see what you mean. Is this what you are talking about?

camera {
 perspective

 direction <0,0,-1>
 angle 60

 transform{ matrix
<0.960168,-0.22715,0.162726,0.0879589,0.798467,0.595579,-0.265217,-0.557543,0.786642,0,0,-15.75>
inverse }

 #local vecFocalPoint = vtransform(<0,3.56,1>, transform{matrix
<0.960168,-0.22715,0.162726,0.0879589,0.798467,0.595579,-0.265217,-0.557543,0.786642,0,0,-15.75>
} );

 focal_point vecFocalPoint
 aperture 1.5
 blur_samples 100
 confidence .9
 variance 1/10000
}

I had to pull the "inverse" keyword out of the vtransform()... that seems to
make it work.

I will play with it more and test your theories.

I really appreciate your help... Thanks so much for taking time out of your day.


Post a reply to this message

From: Alain
Subject: Re: focal_point with camera transform?
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

From: Andy
Subject: Re: focal_point with camera transform?
Date: 10 Nov 2013 19:30:00
Message: <web.5280249c9915e2734dc349de0@news.povray.org>
Alain,

Thank you so much. It's working like a charm now.

I really appreciate you taking time out of your day to help me out -- this will
make things so much easier for me.

-andy.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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