Hello Manish,

Currently when I'm moving scene using mouse , light also move along the scene. 
So how can i fixed light while moving scene ?

When you use the mouse with the default trackball manipulator, you're not moving the scene, you're moving the camera. In the real world, if you move your head, lights in the room seem to move (relative to your head) but they're fixed in the scene and it's your head that moved. That's the same thing you're seeing in your OSG app. Your light *is* fixed in the scene, but your objects too, and you're moving your view point.

If you want to move the scene, you need to do something else. For example you could use the osgManipulator library to put manipulators on your objects and then be able to move them. Then they would move, but the light would remain where it is, so the objects would move relative to the light which seems to be what you want. Or you could make an event handler that looks for mouse clicks and drags, does an intersection with the scene, and then moves the object under the mouse.

Many ways to skin a cat, as you see, it all depends on what you want. In any case, what I describe above can be seen in action in different OSG examples, for example osgmanipulator, osgintersection, etc. Search around the examples and experiment with their code, and you'll get there.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to