Camera view position

classic Classic list List threaded Threaded
2 messages Options
marcoma9023 marcoma9023
Reply | Threaded
Open this post in threaded view
|

Camera view position

Hi,

I'm trying to create a cone of visibility of the camera.

So, through the Perspective matrix I get the vfov and the aspect ratio with which I calculate the hfov.

Through the LookAt matrix I have the coordinate of the camera, but my problem is that I cannot get the coordinate of the point you are looking at.

Studying a bit of OpenGL theory, it would be if I understand correctly, the "At" parameter.
Can you tell me if it matches what is called "Center" in OSG's LookAt?

Thanks for your help
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Camera view position

Yes; "center" and "at" are the same thing.

Note that this can be any point along the view vector, which is why the Matrix::getLookAt method takes an optional "distance" argument.

[edited to add:]
You can also look at the osgearth_3pv example -- it renders a view frustum.
Glenn Waldron / Pelican Mapping