Things like this don't work: (I've got abnormal termination)

osg::Camera* camera = viewer.getCamera();

osg::PositionAttitudeTransform* xform1 = new osg::PositionAttitudeTransform();

xform1->setPosition(osg::Vec3(10.,10.,10.));

xform1->addChild(camera);

root->addChild(xform1);

Can someone please write here a code that works?



----- Original Message ----- From: "Alberto Luaces" <[EMAIL PROTECTED]>
To: "osg users" <[email protected]>
Sent: Wednesday, May 16, 2007 3:49 PM
Subject: Re: [osg-users] Nub Q: how to move camera


El Miércoles 16 Mayo 2007, Roman Grigoriev escribió:
Hi Robert!
I still don't understand how to do this simple way
so I need thing like this camera-SetPositionAndHPR(pos,HPR);
could you plese write here simple code how to move camera manually to
desired position and rotate it to HPR angles
Thanx in advance
Roman

Why can't you attach the camera node to a PositionAttitudeTransform? Anyway,
you can set your position and HPR angles using a osg::MatrixTransform instead
of the PAT, I think it's easier here.

Alberto

----- Original Message -----
From: "Robert Osfield" <[EMAIL PROTECTED]>
To: "osg users" <[email protected]>
Sent: Wednesday, May 16, 2007 3:27 PM
Subject: Re: [osg-users] Nub Q: how to move camera

> Hi Roman,
>
> There are lots of ways of controlling the camera, via one of the range
> of CameraMaipulators that you'll find in osgGA, or a custom
> manipulator likes these, or simple set your views master  Camera's
> View and Projection matrices yourself.
>
> For tracking a node you might want to try the
> osgGA::NodeTrackerManipulator. See the osgplanets example.
>
> Robert.
>
> On 5/16/07, Roman Grigoriev <[EMAIL PROTECTED]> wrote:
>> Hi guys!
>> Sorry for nub Q but what's the easiest way to move camera during
>> simulation?
>> I understand how to move objects using osg::PositionAttitudeTransform
>> but I
>> can't attach camera node to PositionAttitudeTransform that controls
>> camera
>> node. so I have coordinates osg::Vec3 (1,2,3) and angles HPR
>> and need to place and rotate camera how can I do this?
>> Thanx in advance
>> Bye


_______________________________________________
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/

Reply via email to