Hi Igor

On Thu, Dec 9, 2010 at 11:03 AM, Igor Galochkin <[email protected]> wrote:
> Under Focal length I mean the distance from the camera's lens to it's focus. 
> This distance can be different for x and y, for example, if the camera's lens 
> is oval in shape.
>
> I have to write a function which receives, among other parameters, these 2 
> values (x focal length and y focal length) and have to pass it somehow to the 
> OSG viewer. Is there a way to do this at all?

It's clear that you are still confused by the terms and what OpenGL
projection/view matrices do you.  I'd suggest you do some background
reading.

My best guess is what you are thinking of field of view - the angle
between the horizontal and vertical axis.

> If this is important, in the library for which i have to do this, the x axis 
> goes from left to right of the screen, y axis goes form top to bottom of the 
> screen and z axis goes away from the viewer.

In OpenGL and the OSG, the orientation of projected coordinates are
always X+ive to the the right, Y+ve to the top of the screen, and +Zve
out from the screen.  The projection matrix is what sets up the field
of view and near/far planes.

The view matrix positions the world coordinates of your scene relative
to the camera.  Your world coordinates can be any reference frame you
want, it's the view matrix you define the controls this.  The OSG
defaults to loading models and setting the default home position/view
matrix to X+ve to east, Y+ to the north and Z+ve up.  This is
consistent to how the bulk of the vis-sim/GIS industry define world
coordinates.

It's best to always keen your idea of the screen/projected coordinates
as a separate reference frame from your world coordinates in your
scene.  screen/projected coordinate frame is always set by the
convention of OpenGL as I mentioned above, while world coordinates is
chosen by the application to best suit the type of data it will be
dealing with.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to