[osg-users] z-up & camera position & osgthirdpersonview

Fabian Bützow buetz at uni-koblenz.de
Sat Sep 6 02:16:16 PDT 2008


Hi everybody,

i played a bit around with the osgthirdpersonview..

my goal was to draw an additional line for the up vector (Vec3(0.0, 0.0, 
1.0))-
hence i added the fllowing code to the example:

camera->getViewMatrixAsLookAt(*eye, *center, *up); //gives the up vector

//draws a line from origin to up vector
(*v)[9].set(*up);
GLushort idxLoops2[2] = {9, 0 };
geom->addPrimitiveSet( new osg::DrawElementsUShort( 
osg::PrimitiveSet::LINE_LOOP, 2, idxLoops2 ) );

This didnt bring the desired effect,
and I disabled the inverse viewmatrix tranformation to see where the 
orginal viewfrustum would be drawn.
Surpringsliy (for me ;)) the camera looks along the negative z-axis as 
in std opengl...
My up vector however pointed still to z up (and not as expected to y north)

what do i have to do to draw the upvector approprietly?

cheers & a nice weekend
Fabian







More information about the osg-users mailing list