Hi all.. I have some trouble trying to map points from world to screen...
I've found a function within the camera matrix that should give me the world
to screen matrix...

virtual void getWorldToScreen (Matrix        &result, const Viewport& port);

So I took my camera from SimpleSceneManager (which is a PerspectiveCamera),
and called the getWorldToScreen acquiring a matrix...

then I tried to multiply a world point in order to get a screen point like
this:

OSG::Matrix m;

getCamera()->getWorldToScreen( m, *(_viewport.getCPtr()) ); // _viewport is
a ViewportPtr

OSG::Vec3f result;
m.multMatrixVec( _start3d, result ); // _start3d is my 3d world point

the result is somehow very strange... the resulting vector (result) is
something like

( -1702.698730, 3231.838379, 826.523010 )

It should have x and y coords positive within screen space and y coordinate
is very large (my screen does not have 3k height pixels )..


I just want to transform a regular 3d world point into a regular 2d screen
point..Any hints??? (No problem if the map occours within clipping space
(from -1 to 1 in x and y at screen space)...


Thanks!!!!
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to