FYI: I found the object by using obj.getBound.center() and moved it back to where the camera was pointing. :) Thanks!

- Steve

On Tue, 13 Mar 2007, Robert Osfield wrote:

Date: Tue, 13 Mar 2007 08:56:32 +0000
From: Robert Osfield <[EMAIL PROTECTED]>
Reply-To: osg users <[email protected]>
To: osg users <[email protected]>
Subject: Re: [osg-users] Can't find my objects!

Hi Steve,

The best I can do is provide some typical gotcha for othrographic work
- first up the near and far plane clipping could be clipping out your
objects so consider using ortho instead of otrho2D, second you could
be positioning it in the wrong place for this you'll just need to
calculate the the view matrix to point at the right place.

Robert.

On 3/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hello.

I've got a scene where I've got a coule different cameras (a 3D scene,
then a 2D "text" camera that overlays on the 3D scene).  I'd like to add
some 3D objects to my "ortho2D" camera view, but no matter where I put
them, they don't seem to show up.

My stuff looks like this in the 2D camera view:

osg::Node* logo = osgDB::readNodeFile("logo.osg");
osg::Group* rootNode = new osg::Group;
osg::MatrixTransform* positioner = new osg::MatrixTransform;
positioner->setMatrix(
        osg::Matrix::translate(50.0f,850.0f,0.0f) *
        osg::Matrix::scale(1.0f,1.0f,1.0f) *
        osg::Matrix::rotate(osg::inDegrees(90.0f),0.0f,0.0f,0.0f));
positioner->addChild(logo);  // my 3D object
rootNode->addChild(positioner);
osg::CameraNode* camera = new osg::CameraNode;
camera->setProjectionMatrix(osg::Matrix::ortho2D(0,1280,0,1024));
camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
camera->setViewMatrix(osg::Matrix::identity());
camera->setClearMask(GL_DEPTH_BUFFER_BIT);
camera->setRenderOrder(osg::CameraNode::POST_RENDER);
camera->addChild(rootNode);

Am I doing something wrong that I can't see my 3D object no matter where I
place it (in the transform operator in the positioner object) or what
scale I make it?

Is there something that I can do to dump out the xform data or screen
position of my object?

- Steve

--
EMAIL: (h) [EMAIL PROTECTED]  WEB: http://badcheese.com/~steve

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


EMAIL: (h) [EMAIL PROTECTED]  WEB: http://badcheese.com/~steve

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to