POV-Ray : Newsgroups : povray.advanced-users : focal_point with camera transform? Server Time
23 Nov 2024 18:46:30 EST (-0500)
  focal_point with camera transform? (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Andy
Subject: focal_point with camera transform?
Date: 7 Nov 2013 15:05:01
Message: <web.527bf23a113a666c4dc349de0@news.povray.org>
Is it possible to create a perspective camera that doesn't use "location" and
"look_at", but instead uses "transform {matrix <...>}" and have focal_point work
properly?

When I try to use a transform with a camera, focal_point no longer works as
described.

Any help would be greatly appreciated!
-andy.


Post a reply to this message

From: Alain
Subject: Re: focal_point with camera transform?
Date: 7 Nov 2013 22:59:18
Message: <527c6196$1@news.povray.org>

> Is it possible to create a perspective camera that doesn't use "location" and
> "look_at", but instead uses "transform {matrix <...>}" and have focal_point work
> properly?
>
> When I try to use a transform with a camera, focal_point no longer works as
> described.
>
> Any help would be greatly appreciated!
> -andy.
>
>

It's realy easy to set a camera that don't use location and point_at: 
Just don't set them and you get a camera siting at the origin and look 
toward <0,0,1>.

If you transform your camera after seting focal_point, then the 
transform will apply to focal_point the same way it apply to the rest. 
You may want to transform your camera BEFORE you set the facal point.

If you declared your camera with a focal_point and then use 
camera{Camera_Id transform{My_Tranfsorm}}, you may want to change it to:
camera{Camera_Id transform{My_Tranfsorm} focal_point FocalPoint}
This will reset focal_point to the corect location.





Alain


Post a reply to this message

From: Doctor John
Subject: Re: focal_point with camera transform?
Date: 8 Nov 2013 07:42:54
Message: <527cdc4e$1@news.povray.org>
On 07/11/13 20:04, Andy wrote:
> Is it possible to create a perspective camera that doesn't use "location" and
> "look_at", but instead uses "transform {matrix <...>}" and have focal_point work
> properly?
> 
> When I try to use a transform with a camera, focal_point no longer works as
> described.
> 
> Any help would be greatly appreciated!
> -andy.
> 
> 
I did some work on this sort of problem a couple of years ago. If I
understand you correctly, you want to be able to position the look_at at
some arbitrary position within the actual image.

Unfortunately, I'm at work atm but will look up the work I did and post
back this evening (I'm on GMT)

John
-- 
Protect the Earth
It was not given to you by your parents
You hold it in trust for your children


Post a reply to this message

From: Doctor John
Subject: Re: focal_point with camera transform?
Date: 8 Nov 2013 18:13:54
Message: <527d7032$1@news.povray.org>
On 08/11/13 12:43, Doctor John wrote:
> On 07/11/13 20:04, Andy wrote:
>> Is it possible to create a perspective camera that doesn't use "location" and
>> "look_at", but instead uses "transform {matrix <...>}" and have focal_point work
>> properly?
>>
>> When I try to use a transform with a camera, focal_point no longer works as
>> described.
>>
>> Any help would be greatly appreciated!
>> -andy.
>>
>>
> I did some work on this sort of problem a couple of years ago. If I
> understand you correctly, you want to be able to position the look_at at
> some arbitrary position within the actual image.
> 
> Unfortunately, I'm at work atm but will look up the work I did and post
> back this evening (I'm on GMT)
> 
> John
> 

Dammit, I can't find the files immediately - maybe a conjunction of
fatigue and somewhat-upset son (he can't understand why Peppa Pig is not
on Feegle-on-Demand). I'll keep looking.

John
-- 
Protect the Earth
It was not given to you by your parents
You hold it in trust for your children


Post a reply to this message

From: Andy
Subject: Re: focal_point with camera transform?
Date: 9 Nov 2013 00:35:00
Message: <web.527dc85e9915e2734dc349de0@news.povray.org>
Alain <kua### [at] videotronca> wrote:

> > Is it possible to create a perspective camera that doesn't use "location" and
> > "look_at", but instead uses "transform {matrix <...>}" and have focal_point work
> > properly?
> >
> > When I try to use a transform with a camera, focal_point no longer works as
> > described.
> >
> > Any help would be greatly appreciated!
> > -andy.
> >
> >
>
> It's realy easy to set a camera that don't use location and point_at:
> Just don't set them and you get a camera siting at the origin and look
> toward <0,0,1>.
>
> If you transform your camera after seting focal_point, then the
> transform will apply to focal_point the same way it apply to the rest.
> You may want to transform your camera BEFORE you set the facal point.
>
> If you declared your camera with a focal_point and then use
> camera{Camera_Id transform{My_Tranfsorm}}, you may want to change it to:
> camera{Camera_Id transform{My_Tranfsorm} focal_point FocalPoint}
> This will reset focal_point to the corect location.
>
> Alain

I tried that -- no dice...

Here is a normal camera using look_at and location:
camera {
 perspective
 angle 60

 location<0,7,7>
 look_at<0,0,-1>

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

Then I do this, and it doesn't work:
camera {
 perspective
 direction <0,0,-1>
 angle 60

 transform { matrix<1,0,0,0,1,0.1,0,-0.1,1,0,-1.75,-12> inverse }

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

The reason why I am using direction with z negative is because I am using OpenGL
to generate the matrix, where Z goes towards the camera, not away.


Post a reply to this message

From: Andy
Subject: Re: focal_point with camera transform?
Date: 9 Nov 2013 00:45:01
Message: <web.527dcacc9915e2734dc349de0@news.povray.org>
> camera {
>  perspective
>  angle 60
>
>  location<0,7,7>
>  look_at<0,0,-1>
>
>  focal_point <0.0,3.5,1>
>         aperture 0.5
>         blur_samples 100
>         confidence .9
>         variance 1/10000
> }
>
> Then I do this, and it doesn't work:
> camera {
>  perspective
>  direction <0,0,-1>
>  angle 60
>
>  transform { matrix<1,0,0,0,1,0.1,0,-0.1,1,0,-1.75,-12> inverse }
>
>  focal_point <0.0,3.5,1>
>         aperture 0.5
>         blur_samples 100
>         confidence .9
>         variance 1/10000
> }
>
> The reason why I am using direction with z negative is because I am using OpenGL
> to generate the matrix, where Z goes towards the camera, not away.


As soon as i wrote "Where Z goes towards the camera, not away." and hit "enter",
it hit me.

In the matrix above, i am translating -12 on the Z. Since direction is set to be
negative, I need to compensate for that by changing this:

focal_point <0.0,3.5,1>

to this:

focal_point <0.0,3.5,-11>

-12-11=1, and 1 is where i want the focal point to be set up on Z.

It seems to work? Am I heading down the right path?


Post a reply to this message

From: Alain
Subject: Re: focal_point with camera transform?
Date: 9 Nov 2013 13:25:20
Message: <527e7e10$1@news.povray.org>

>
>> camera {
>>   perspective
>>   angle 60
>>
>>   location<0,7,7>
>>   look_at<0,0,-1>
>>
>>   focal_point <0.0,3.5,1>
>>          aperture 0.5
>>          blur_samples 100
>>          confidence .9
>>          variance 1/10000
>> }
>>
>> Then I do this, and it doesn't work:
>> camera {
>>   perspective
>>   direction <0,0,-1>
>>   angle 60
>>
>>   transform { matrix<1,0,0,0,1,0.1,0,-0.1,1,0,-1.75,-12> inverse }
>>
>>   focal_point <0.0,3.5,1>
>>          aperture 0.5
>>          blur_samples 100
>>          confidence .9
>>          variance 1/10000
>> }
>>
>> The reason why I am using direction with z negative is because I am using OpenGL
>> to generate the matrix, where Z goes towards the camera, not away.
>
>
> As soon as i wrote "Where Z goes towards the camera, not away." and hit "enter",
> it hit me.
>
> In the matrix above, i am translating -12 on the Z. Since direction is set to be
> negative, I need to compensate for that by changing this:
>
> focal_point <0.0,3.5,1>
>
> to this:
>
> focal_point <0.0,3.5,-11>
>
> -12-11=1, and 1 is where i want the focal point to be set up on Z.
>
> It seems to work? Am I heading down the right path?
>
>
>
>
Try defining your camera without focal blur and only add it after the 
transform.

Normaly, focal_point define an absolute location relative to the origin 
of the coordinate system.


Post a reply to this message

From: Andy
Subject: Re: focal_point with camera transform?
Date: 9 Nov 2013 18:05:00
Message: <web.527ebf289915e2734dc349de0@news.povray.org>
Alain <kua### [at] videotronca> wrote:

> >
> >> camera {
> >>   perspective
> >>   angle 60
> >>
> >>   location<0,7,7>
> >>   look_at<0,0,-1>
> >>
> >>   focal_point <0.0,3.5,1>
> >>          aperture 0.5
> >>          blur_samples 100
> >>          confidence .9
> >>          variance 1/10000
> >> }
> >>
> >> Then I do this, and it doesn't work:
> >> camera {
> >>   perspective
> >>   direction <0,0,-1>
> >>   angle 60
> >>
> >>   transform { matrix<1,0,0,0,1,0.1,0,-0.1,1,0,-1.75,-12> inverse }
> >>
> >>   focal_point <0.0,3.5,1>
> >>          aperture 0.5
> >>          blur_samples 100
> >>          confidence .9
> >>          variance 1/10000
> >> }
> >>
> >> The reason why I am using direction with z negative is because I am using OpenGL
> >> to generate the matrix, where Z goes towards the camera, not away.
> >
> >
> > As soon as i wrote "Where Z goes towards the camera, not away." and hit "enter",
> > it hit me.
> >
> > In the matrix above, i am translating -12 on the Z. Since direction is set to be
> > negative, I need to compensate for that by changing this:
> >
> > focal_point <0.0,3.5,1>
> >
> > to this:
> >
> > focal_point <0.0,3.5,-11>
> >
> > -12-11=1, and 1 is where i want the focal point to be set up on Z.
> >
> > It seems to work? Am I heading down the right path?
> >
> >
> >
> >
> Try defining your camera without focal blur and only add it after the
> transform.
>
> Normaly, focal_point define an absolute location relative to the origin
> of the coordinate system.

Would it help if I uploaded the POV file?  Here is what I am working with:
http://www.heinleins.com/library.pov.zip


Post a reply to this message

From: Alain
Subject: Re: focal_point with camera transform?
Date: 10 Nov 2013 14:09:37
Message: <527fd9f1$1@news.povray.org>



> Would it help if I uploaded the POV file?  Here is what I am working with:
> http://www.heinleins.com/library.pov.zip
>
>
>
Testing your scene.

Added some axis centered at the focal_point, and a second axis group 
that is transformed by the matrix, to beter see whats going on.

Doing a 2 frames animation with the matrix transform *before* and 
*after* setting the focal point.
Also checking using rotate and translate.

In both cases, BOTH results are identical. It looks like it may be a 
bug, but it may be as intended but not intuitive.

Apparently, it don't mather wether the transform is applyed before or 
after you set the focal point, the transform always apply to the whole 
camera. It looks similar to the way turbulence work if it's not 
contained in a warp block.

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.



Alain


Post a reply to this message

From: Andy
Subject: Re: focal_point with camera transform?
Date: 10 Nov 2013 18:00:01
Message: <web.52800f589915e2734dc349de0@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...


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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