[osg-users] Newbie question #1: How to get

Karl Karsten kkarsten62 at yahoo.de
Sun Sep 7 08:19:48 PDT 2008


Hello,

I am new in this group (and to openSceneGraph as well) and this is my first E-Mail. I am experimenting a bit for own to brush up my C++ and 3D Graphics skills. I am using Ecplise, mingw, Qt4 and OpenSceneGraph - it's really a powerfull toolkit! -.

I am just coding around HUDtext and EventHandling.
I would like to display the local (mouse) and the corresponding model coordinates as HUD text in my scene. 

I have written a new GUIActionAdapter which should give back the coordinate to the Qt GUI which updated then the HUD text.

bool QtOsgPickHandler::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)
{
    switch (ea.getEventType())
    {
    case (osgGA::GUIEventAdapter::MOVE):
    {
        float localX = ea.getX(); // the mouse position, Ok
        float localY = ea.getY();
    
        float modelX = ?     
        float modelY = ?
        float modelZ = ?

    emit updateHudText(modelX, modelY, modelZ); // Qt specific signal to update the HUD text
...

What is the way to transform the mouse position to model coordinates?

Many thanks for a feedback.

Karl ...

__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080907/ccab0109/attachment-0002.htm>


More information about the osg-users mailing list