[osg-users] Follow an object

2010-02-10 Thread Tufan Taş
Hi,

I am using a custom manipulator that translates and rotates the screen. I add a 
model as a node that is the base model and after that I add another model again 
as a node. I want this last added node to stay on screen while I rotate and 
translate the screen. In other words I want model to move with screen. How can 
I perform that action?


Thank you!

Cheers,
Tufan

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=23900#23900





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Follow an object

2010-02-10 Thread Vincent Bourdier

Hi,

Have a look on HUD example. this is a way to add geometries to the 
camera, and so this geometry is always visible in the screen, at the 
same place.


Hope this helps.

Regards,
Vincent


Tufan Taş a écrit :

Hi,

I am using a custom manipulator that translates and rotates the screen. I add a 
model as a node that is the base model and after that I add another model again 
as a node. I want this last added node to stay on screen while I rotate and 
translate the screen. In other words I want model to move with screen. How can 
I perform that action?


Thank you!

Cheers,
Tufan

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=23900#23900





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  



__ Information from ESET NOD32 Antivirus, version of virus signature 
database 4852 (20100209) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Follow an object

2010-02-10 Thread Tufan Taş
Hi,

I add geometries on the screen but when I use the manipulator to translate the 
scene I want that object to translate also. Like a a cockpit that ground and 
sky moves when rotate but the cockpit image stays on the scene.

Thank you!

Cheers,
Tufan

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=23905#23905





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Follow an object

2010-02-10 Thread Vincent Bourdier
In osgHud example, some text is rendered front to the camera, whatever 
the camera position/orientation is.

You can replace the text using 3D geometries and keeping the same behavior.

If this is not what you are looking, give us more explanations...

Vincent.

Tufan Taş a écrit :

Hi,

I add geometries on the screen but when I use the manipulator to translate the 
scene I want that object to translate also. Like a a cockpit that ground and 
sky moves when rotate but the cockpit image stays on the scene.

Thank you!

Cheers,
Tufan

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=23905#23905





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  



__ Information from ESET NOD32 Antivirus, version of virus signature 
database 4852 (20100209) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Follow an object

2010-02-10 Thread Ümit Uzun
Hi Tufan,

You can use NodeTracker Manipulator, so you can track your origin node by
your camera and manipulate your camera's rotation and oriantation due to
your tracked node too.

Regards.

Ümit Uzun


2010/2/10 Vincent Bourdier vincent.bourd...@gmail.com

 In osgHud example, some text is rendered front to the camera, whatever the
 camera position/orientation is.
 You can replace the text using 3D geometries and keeping the same behavior.

 If this is not what you are looking, give us more explanations...


 Vincent.

 Tufan Taş a écrit :

 Hi,


 I add geometries on the screen but when I use the manipulator to translate
 the scene I want that object to translate also. Like a a cockpit that ground
 and sky moves when rotate but the cockpit image stays on the scene.

 Thank you!

 Cheers,
 Tufan

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=23905#23905





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




 __ Information from ESET NOD32 Antivirus, version of virus
 signature database 4852 (20100209) __

 The message was checked by ESET NOD32 Antivirus.

 http://www.eset.com


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Follow an object

2010-02-10 Thread Tufan Taş
Hi,

I use arrow keys to move scene by my custom manipulator. I found a code as in 
the following but I cannot use my manipulator when using 
NodeTrackerManipulator. 

osgGA::NodeTrackerManipulator::TrackerMode trackerMode = 
osgGA::NodeTrackerManipulator::NODE_CENTER_AND_ROTATION;
osgGA::NodeTrackerManipulator::RotationMode rotationMode = 
osgGA::NodeTrackerManipulator::TRACKBALL;
osg::ref_ptrosgGA::NodeTrackerManipulator tm = new 
osgGA::NodeTrackerManipulator;
 tm-setTrackerMode(trackerMode);
 tm-setRotationMode(rotationMode);
 tm-setMinimumDistance(50.0);
 tm-setTrackNode(NodeToTrack);

 viewer-setCameraManipulator(tm.get());

Thank you!

Cheers,
Tufan

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=23914#23914





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Follow an object

2010-02-10 Thread Tufan Taş
Hi,

This code works as I need that draws object on scene and does not move while I 
translate the scene but how can I add a node instead of a geode? I add directly 
the node but it did not seen on the screen.

ref_ptrGeode HUD = addHUD();
ref_ptrStateSet stateSet = HUD-getOrCreateStateSet();

stateSet-setMode(GL_LIGHTING, osg::StateAttribute::OFF);
stateSet-setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);


   
stateSet-setRenderBinDetails(11, RenderBin);

ref_ptrMatrixTransform modelviewAbs (new MatrixTransform);
modelviewAbs-setReferenceFrame(Transform::ABSOLUTE_RF);
modelviewAbs-setMatrix(Matrix::identity());

modelviewAbs-addChild(HUD.get());

ref_ptrProjection projection (new Projection());
projection-setMatrix(Matrix::ortho2D(0, 1280, 0, 1024)); 
//traits-width traits-height
projection-addChild(modelviewAbs.get());
root-addChild(projection.get());

Thank you!

Cheers,
Tufan

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=23949#23949





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org