Hi Laura,

the osgGA library holds classes that are responsible for managing events
from mouse, keyboard etc. You would be interested in osgGA::GUIEventHandler
and its *handle* method. So You might want to inherit and override the *handle
*method that will do processing based on keypress event - the event and the
key are hidden in the first argument osgGA::GUIEventAdapter.

Once you have Your new EventHandler you simply add it to Your viewer -
there is a method for it, see the osgviewer.cpp example

The best for moving the ship in your scene is osg::MatrixTransoform - this
is a node with a matrix to spatially manipulate parts of the scenegraph.
Let this MatrixTransform be your root of the model (its child can be Your
ship model) and you modify only the matrix which is part iof the MT.

Do a research on the mentioned above, if you got stuck feel free to ask,
someone might give you some code snippets as well

Good luck!

Nick


On Mon, Apr 28, 2014 at 7:03 AM, Laura Mac <
randomweirdadventure...@yahoo.com> wrote:

> Hello all,
>
> I am a beginner with OSG and with graphics programming in general, so
> please excuse the elementary question.
>
> I am interested in rendering a ship model rotating the model (through
> interpolation) whenever particular keys are pressed. As I am new to OSG, I
> have been browsing through the provided examples to find anything similar
> which I could use as my base. However, it seems most examples do not
> demonstrate on-call model translation/transformation.
>
> Could anyone direct me to an example of a similar implementation, or at
> least a number of classes/functions which I would find useful?
>
> Thank you very much!
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=59167#59167
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
trajce nikolov nick
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to