[osg-users] EyePoint from CullVisitor

Robert Osfield robert.osfield at gmail.com
Thu Oct 18 01:56:47 PDT 2007


Hi Jeff,

Is there a reason for using 1.0?  2.2 is better alround, and it far
easier for us to support your usage of as 1.0 is almost 2 years past.

As for your particular problem, wanting the eye point in world
coordinates can be derived from the CullVisitor's current
ModelViewMatrix * Inverse(ViewMatrix).

Also please note that the multiplication order in the OSG is:

  v' = v * M;


Robert.

On 10/17/07, Jeffrey M Short <jshort8 at csc.com> wrote:
>
> Hello
>
> First off I'm using OSG 1.0.
>
> I am deriving a class from osg::Drawable::CullCallback.  I'm overloading
> the cull function [virtual bool cull(osg::NodeVisitor* nv, osg::Drawable*
> drawable, osg::State*) const].  I am trying to get the eye location in
> World Coordinates.  It seems as though CullVisitor::getEyePoint() returns
> the eye location in Local Coords.  I've tried tried multiplying by
> osg::computeLocalToWorld(nv->getNodePath()) and
> osg::computeWorldToLocal(nv->getNodePath()), but I've had no success.
>
> In some cases, I already know that my drawable has one MatrixTransform
> above it so I calculate the following:
> osg::Matrixd::inverse(xfrom->getMatrix()) * osg::Vec4d(nv->getEyePoint(),
> 1).  This works.  But it won't work for cases when there's more than 1
> Transfrom on the nodepath.  That's why I was trying
> osg::computeLocalToWorld.  The best thing would be to get the eye point in
> world coordinates directly without having to calculate it repeatedly from
> local coordinates in each drawable's CullCallback.  Any suggestions?
>
>
> Also I want to reply to some response made to other questions I have
> submitted.  How do I do that?
>
> Thank you,
>      Jeff
>
> Computer Sciences Corporation
> Registered Office: 2100 East Grand Avenue, El Segundo California 90245, USA
> Registered in USA No: C-489-59
>
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> This is a PRIVATE message. If you are not the intended recipient, please
> delete without copying and kindly advise us by e-mail of the mistake in
> delivery.
> NOTE: Regardless of content, this e-mail shall not operate to bind CSC to
> any order or other contract unless pursuant to explicit written agreement
> or government initiative expressly permitting the use of e-mail for such
> purpose.
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



More information about the osg-users mailing list