|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>
>> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>
>> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
|
|