The geometric data for the view volume in osgthirdpersonview is in OpenGL
eye coordinate space, and is transformed by the inverse modelview to put it
into world (object) space.

The up vector your code gets from the camera is already in world space.
However, your code treats it like it's in eye space, and incorrectly
back-transforms it (like the rest of the eye space view volume).

So, you've made a mistake in your linear algebra. You'll need to rethink the
coordinate spaces you are working with and fix your code accordingly.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859 9466




> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of Fabian Bützow
> Sent: Saturday, September 06, 2008 3:16 AM
> To: [email protected]
> Subject: [osg-users] z-up & camera position & osgthirdpersonview
> 
> 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
> 
> 
> 
> 
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce
> negraph.org

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

Reply via email to