How to customize mouse input?

How to customize mouse input?

Post by Wang » Fri, 30 May 2003 18:14:56



My scenario is: I have 3 f16 airplanes flying in the same environment,
in their own manner. I want to select a certain f16 and, under the
selection mode, make the mouse input change camera angle around the
selected f16, like examining it.

How should I do it? I noticed the
/src/Inventor/examples/IVF/CustomViewer gave an example on how to
overwrite thumb wheel control, (but didn't give code on how to
implement camera rotating.) Is there a similar way to overwrite mouse
input?

Thanks a lot!!

 
 
 

How to customize mouse input?

Post by Mike He » Sun, 01 Jun 2003 00:26:40



> My scenario is: I have 3 f16 airplanes flying in the same environment,
> in their own manner. I want to select a certain f16 and, under the
> selection mode, make the mouse input change camera angle around the
> selected f16, like examining it.

> How should I do it? I noticed the
> /src/Inventor/examples/IVF/CustomViewer gave an example on how to
> overwrite thumb wheel control, (but didn't give code on how to
> implement camera rotating.) Is there a similar way to overwrite mouse
> input?

If the viewer is in selection mode you don't need to "override"
the mouse input, just respond to it.  In selection mode the
viewer does not process mouse input, it just converts the events
to Open Inventor event objects and sends them to the scene graph
using SoHandleEventAction, where SoEventCallback (and other)
nodes can respond to the events.

In the Open Inventor 4.0 SDK there is an example that is very
close to what you are trying to do.  Look at the file
$OIVHOME/src/Inventor/examples/Qt/QtLargeModelViewer/QLmv.cxx
and specifically the method OnMouseMove().  The application is
based on Qt, but the event handling is portable Open Inventor.
To try it out, run the QtLargeModelViewer (pre-built on Windows),
load the file $OIVHOME/data/models/toys/TrackSample/animation.iv.
Uder the Animations menu select "car1" (for example).  Now you
should be following the selected car.  In the same menu select
"Free View" and go into selection mode.  Now you should be able
to use the mouse to rotate freely around the car while still
being animated along its path.

-Mike
 TGS Inc, http://www.tgs.com

 
 
 

How to customize mouse input?

Post by Wang » Tue, 03 Jun 2003 18:17:55



> In the Open Inventor 4.0 SDK there is an example that is very
> close to what you are trying to do.  Look at the file
> $OIVHOME/src/Inventor/examples/Qt/QtLargeModelViewer/QLmv.cxx
> and specifically the method OnMouseMove().  The application is
> based on Qt, but the event handling is portable Open Inventor.

The version I purchased (TGS Open Inventor 3.1) does not give such an
example, I couldn't find a 'Qt' folder in the example folder

Quote:> To try it out, run the QtLargeModelViewer (pre-built on Windows),
> load the file $OIVHOME/data/models/toys/TrackSample/animation.iv.
> Uder the Animations menu select "car1" (for example).  

Nor can I find this animation.iv fild in the toys folder.

Can I download it from your website? I'm a licenced user.

Quote:

> -Mike
>  TGS Inc, http://www.tgs.com

 
 
 

How to customize mouse input?

Post by Mike He » Wed, 04 Jun 2003 00:35:20




> > In the Open Inventor 4.0 SDK there is an example that is very
> > close to what you are trying to do.  Look at the file
> > $OIVHOME/src/Inventor/examples/Qt/QtLargeModelViewer/QLmv.cxx
> > and specifically the method OnMouseMove().  The application is
> > based on Qt, but the event handling is portable Open Inventor.

> The version I purchased (TGS Open Inventor 3.1) does not give such an
> example, I couldn't find a 'Qt' folder in the example folder

That's correct, note I said Open Inventor 4.0 (most current release).

Quote:> > To try it out, run the QtLargeModelViewer (pre-built on Windows),
> > load the file $OIVHOME/data/models/toys/TrackSample/animation.iv.
> > Uder the Animations menu select "car1" (for example).  

> Nor can I find this animation.iv fild in the toys folder.

> Can I download it from your website? I'm a licenced user.

Yes.

-Mike
 TGS Inc, http://www.tgs.com

 
 
 

1. customized engines input problem

-

Hello there !

I have some trouble using a SoMFLong as an input field into an engine.
When accessing that field to set the value, I have a segmentation fault.
The field is obviously uninitialized, and although some default values
are provided in my engine I can't get it to work properly.
Here's what I tried:

myEngine->the_mf_long_int_input.setValues(..correct args..)

myEngine->the_mf_long_int_input.connectFrom(..a ptr to a SoMFLong..)

with the following code in myEngine.h :

        SoMFLong   the_mf_input;

and the corresponding code in myEngine.c++ :

SO_ENGINE_ADD_INPUT(the_mf_long_int_input, (-1));

I would appreciate any suggestions/ideas

More generally I'm wondering with using ptr as input in Inventor is so
scarce... It would indeed save some memory.

Stephane Morvan

*************************************************************************
*                  Clemson Design Methodology Group                     *
*                                                                       *
* Home          : (803)-639-3755  Office : (803)-656-0837               *

* WWW           : http://www.eng.clemson.edu/dmg/people/morvan.html        *
*                                                                       *
*************************************************************************

2. Loading maps or bsps

3. 3D input with a mouse

4. GAME DEVELOPER - NEW

5. Animate by mouse input.....

6. bump displacement technique question

7. mouse input for 3d

8. Gimp+Wacom

9. Newbe question on mouse input / MaxFPS

10. mouse input..

11. Mouse Input

12. windows mouse input