Navigation |
Day 5Virtools Training Part 5(Virtual Reality) Goal: Provide an easy, reusable, modular platform for developing Virtual Reality simulations in Virtools. Features: 1) simple nmo that can be imported and 'VR-tize' the world. 2) common variables for the user to manipulate. system, head, hand, joy axis, joy buttons. 3) support for different screen setups on different systems (handled invisibly from the user's perspective). 4) a desktop simulator mode, where the mouse and keys manipulate the position of the head and wand. Also includes avatar for head and wand. Currently based on the 'CAVELib' simulator controls. simulator_controls.txt Files: DukeVR_Base_v0.4.nmo DukeVR_ScreensSimulator_v0.2.nmo DukeVR_TrackingSimulator_v0.2.nmo Setup: 1) load an existing file (or just a new file if there is no world yet). 2) goto resources, import file, select DukeVR_Base_... 3) if the vr base is not already installed on your computer, you need to put the DukeVR_TrackingSimulator, and DukeVR_ScreensSimulator nmo's in the search path. This is as easy as putting it in the current directory of the project. Or you can put in the root directory of Virtools [ie.. C:\Program Files\Virtools\Virtools Dev 3.5] 4) You will need to add a VRPack.cfg file (can be empty) to the project's directory. Using: ![]() 1) the variables are 4 frames (system, head, hand, hand2) , 2 axis's, and 6 buttons. 2) [advanced, you can skip to point 3] there are 2 copies of these variables, one on the master and one on the render/slave computers. they are differentiated by name and color. here is the general flow over time: tracking system or simulator-->red vars-->distributed to cluster-->green vars. Which variables to use is key to creating properly synchronized applications. 3) in general you can just use the green vars, as long as you are aware that they will be overwritten each frame. 4) in general modify the red VR system to 'drive' the cave around the world. 5) reading/using the head and hand frames is the way to do collision detection and other user interaction. 6) use the "is VR loaded and connected" in combination with a Binary Switch. Loop back if false, and on true proceed with script. This will make sure that the VRSystem and other objects are initialized. [I usually use this variable once in a 'start all scripts' scipt.] Coordinate System and Units: ![]() 1) the the center of the floor of the DiVE is 0,0,0 2) the units are in meters. 3) the walls are approximately 2.9m x 2.9m [although you technically might not want to depend on this distance for text display (other VR setups might have different dimensions)] 4) y+ is up, z+ is into the front wall, x+ is to the right. this is a left handed coordinate system. Navigation Example (using variables in the DukeVR base): [note the use of red variables since we are modifying the VRSystem] Files for Developement of the Duke VR Base: (not needed by regular users) DukeVR_allone.cmo [All the nmo's in a single file, this is where things are edited] DukeVR_Tracking_v0.3.nmo [the routines for VRPN, note: the vr base loads the tracking nmo first if it can find it, so don't have both tracking the trackingsimulator in the same searchpath/directory] DukeVR_Screens_v0.3.nmo Try the following exercises:*** *** |