We actually subclasses the wand behaviour, but I've left in the relevant config file lines for the basic usage. The likely culprit for a work device interface but no interaction is either not attaching the behaviour to the ViewPlatform (see the end of this message), or not assigning ButtonActions in the WandViewBehavior. Good luck! I'm happy to see other people building ConfiguredUniverse apps, it makes our lives so much easier!
// This calls up the JNI access to the trackd API (NewDevice trackd VRCOTrackdInputDevice)
// Create logical names for the available sensors in the specified input // devices. The last argument is the sensor's index in the input device. (NewSensor head trackd 0) (NewSensor wand trackd 1) (NewSensor controller trackd 2)
// Set the 6DOF mouse sensor hotspot in the local sensor coordinate system. // The hotspot is simply the "active" point relative to the sensor origin // which interacts with the virtual world, such as the point used for picking // or grabbing an object. Its interpretation is up to the sensor behavior. // Here it is 2 meters long (SensorAttribute wand Hotspot (0.0 0.0 -2.0))
// Register the input devices defined in this file. // (PhysicalEnvironmentAttribute CAVE InputDevice trackd)
// Register the sensor which will drive head tracking. // (PhysicalEnvironmentAttribute CAVE HeadTracker head)
// Define the physical body. // // The head origin is halfway between the eyes, with X extending to the right, // Y up, and positive Z extending into the skull. // (NewPhysicalBody CAVEUser)
// Set the interpupilary distance. This sets the LeftEyePosition and // RightEyePosition to offsets of half this distance along both directions of // the X axis. // (PhysicalBodyAttribute CAVEUser StereoEyeSeparation 0.066)
// Define the position and orientation of the head relative to the tracker // mounted on the head. // (PhysicalBodyAttribute CAVEUser HeadToHeadTracker (( 1.0 0.0 0.0 0.000) ( 0.0 1.0 0.0 0.000) ( 0.0 0.0 1.0 0.000)))
(NewView view0) //Attach your Screen(s) to the view here... //The following lines are relevant to a stereo display with head tracking (ViewAttribute view0 StereoEnable true) (ViewAttribute view0 TrackingEnable true)
//Generate the navigation behaviour [sic] (NewViewPlatformBehavior vpb com.sun.j3d.utils.behaviors.vp.WandViewBehaviorBehavior)
// Set properties specific to WandViewBehavior (ViewPlatformBehaviorProperty vpb MatrixIndices2D 0 5) //this line is specific to our trackd JNI code (ViewPlatformBehaviorProperty vpb Sensor2D controller) (ViewPlatformBehaviorProperty vpb ReadAction2D Rotation) (ViewPlatformBehaviorProperty vpb Sensor6D wand) (ViewPlatformBehaviorProperty vpb ButtonAction6D 0 GrabView) (ViewPlatformBehaviorProperty vpb ButtonAction6D 1 TranslateForward) (ViewPlatformBehaviorProperty vpb ButtonAction6D 2 TranslateBackward)
//The below lines specialize the navigation to the scale of your world and personal preferences // Default normal translation speed is 0.1 physical meters per second. (ViewPlatformBehaviorProperty vpb TranslationSpeed 0.200 VirtualUnits PerSecond)
// Default acceleration time from button down to normal translation speed is // 1 second. This is also the acceleration time from normal to fast speed. (ViewPlatformBehaviorProperty vpb AccelerationTime 2.0)
// Default time at constant normal speed is 8 seconds. (ViewPlatformBehaviorProperty vpb ConstantSpeedTime 5.0)
// Default fast speed factor is 10.0 times normal translation speed. (ViewPlatformBehaviorProperty vpb FastSpeedFactor 20.0)
// Default 6DOF sensor echo is Gnomon (ViewPlatformBehaviorProperty vpb EchoType Beam)
// Default 6DOF sensor echo color is white (ViewPlatformBehaviorProperty vpb EchoColor 1.0 0.7 0.0)
//Make sure to attach the behaviour to the ViewPlatform, or your behaviour won't work! (NewViewPlatform vp) (ViewPlatformAttribute vp ViewPlatformBehavior vpb)
Ahmed Bayyari wrote:
Hi all, i'm trying to use the WandViewBehavior in a ConfiguredUniverse application. I wrote a Java interface for "trackd" that is working great, I get all the sensor and button values correctly from the wand, the only problem i'm having is controlling (rotating, scaling, translating) objects in a "ConfiguredUniverse" using the WandViewBehavior. I'm using a configuration file to setup the wand behavior and i can see and move the wand around in virtual space. But like i said, i can't manipulate objects in the world using the wand. Thanks a lot for any info u can provide. Ahmed
------------------------------------------------------------------------ Do you Yahoo!? Yahoo! Search - Find what you’re looking for faster. <http://search.yahoo.com/?fr=ad-mailsig-home> =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".