This tutorial shows how pointing devices can be implemented as VRML prototypes. (sources: cppscript.cpp, mypointer.wrl, pointertest.wrl). How to compile a C++ script can be seen in the cppscript example.
These kind of pointing device are part of the virtual environment and therefore can be used in stereoskopic displays.
This example uses the position of the winmouse on the virtual projection plane as sensor data to controll the pointer. For this, the WIN_EVENTS_SCRIPT is used as a native interface to provide these data to the virtual environment. To void conflicts with the default 2D pointing device it should be disabled.
pPointer->SetEnabled(false);To view this example load the pointertest.wrl file with the changed glutCyberle VRML-Browser. You'll see an arrow that moves with the mouse on the projections screen, but if the projected line hits something in the scene the pointer clues to the surface of this object. If the object is in a group with a touchsensor node, the color of the arrow changes from blue to red.