html5-img
1 / 29

Creating Virtual Reality Applications Using FreeVR

David J. Zielinski djzielin@duke.edu Friday Visualization Forum October 1 st ,2004. Creating Virtual Reality Applications Using FreeVR. Overview. What is Virtual Reality? What are my choices? Why use FreeVR? FreeVR program outline Application demos. 1) What is Virtual Reality?.

keanu
Télécharger la présentation

Creating Virtual Reality Applications Using FreeVR

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. David J. Zielinski djzielin@duke.edu Friday Visualization Forum October 1st,2004 Creating Virtual Reality Applications Using FreeVR

  2. Overview • What is Virtual Reality? • What are my choices? • Why use FreeVR? • FreeVR program outline • Application demos

  3. 1) What is Virtual Reality?

  4. What is Virtual Reality? • Physically immersive (generate input to user's sensory systems) • Interactive (user can change the experience) Examples: reading a book (not interactive or immersive) video game (interactive but not immersive) 3-d movie (immersive but not interactive)

  5. What can we use for physically immersive? • 3-d vision • projection systems: [anaglyphic (red/blue), polarized, active stereo] • head mounted displays.

  6. What can we use for physically immersive? • 3-d sound • multichannel speaker setups • Headphone simulation

  7. What can we use for physically immersive? • Other: • Touch/force feedback • Taste • Smell • Environmental conditions (temperature) • Accelerations/motion • Direct connection to human nervous system

  8. What can we use for interactive? • location tracking systems: magnetic, video, ultra-sonic

  9. What can we use for interactive? • joysticks: wands, game controllers • other: gloves, eye tracking, biological indicators (heart-rate, breathing), props (steering wheels, fishing poles)

  10. 2) What are my choices for developing an application/experience? • Write from scratch • Low-level library • Medium-level library (scenegraph) • High-level graphical program • Use domain-specific, off the shelf program

  11. Write from scratch • Pro: • complete control • maximum performance/speed possible • Con: • Long, difficult development • Often device dependent

  12. Low-level library(CAVELib, FreeVR, DIVERSE) • Pro: • lots of control (C/C++,OpenGL programming) • device independent • Con: • difficult for non-programmers, • more control/freedom than most applications require

  13. Medium-level library (OpenSceneGraph, Performer)

  14. Medium-level library (OpenSceneGraph, Performer) • Pro: • built in algorithms to cull (eliminate) non-viewable objects • built in algorithms for collision detection • Con: • Still lots of programming • learning curve to use scenegraph format • usually still low-level library dependent

  15. High-level graphical program (Virtools)

  16. High-level graphical program (Virtools) • Pro: • Easy visual design of worlds • Visual, flow design for object behaviors • Con: • Expensive • speed/performance? • Still have to learn to “program”

  17. Use domain-specific, off the shelf program (Amira, VMD)

  18. Use domain-specific, off the shelf program (Amira, VMD) • Pro: • Very easy, especially if group is already using non-VR version of program • Con: • Individual configuration • not applicable to making custom applications

  19. 3) Why use FreeVR? • device independence (input and output) • free/opensource (CAVELib is not) • actively developed (cluster support soon) • I know how to configure it

  20. How does it become device independent? • configuration file (.freevrrc) maps buttons, sensors, and screen locations to FreeVR internals. Different physical configurations require different .rc settings. • on startup FreeVR opens all necessary windows, and handles projection matrices, so correct view is on correct screen.

  21. abstraction of buttons: int pressed=vrGet2switchValue(which_button); if(pressed) printf(“user pressed the button!”);

  22. abstraction of location sensors: vrPointGetRWFrom6sensor(&wand_locpnt, WAND_SENSOR); float x,y,z; x=wand_locpnt.v[0]; y=wand_locpnt.v[1]; z=wand_locpnt.v[2]; if((x<...) AND (y<...) AND (z<...)) /* we are touching an object, do something */

  23. abstraction of display space: we provide single function, that is called for each frame, for each render window. void draw_world() { clear_screen glTranslatef(0,5,-5); /* real world coordinates draw_object }

  24. 4) FreeVR program Outline pt.1 Main(){ initialization calls setup callback of world render function setup callback of gfx initialization while(!terminate){ vrFrame(); update(); /* next slide */ } }

  25. FreeVR program Outline pt.2 Update(){ check buttons check sensor positions do logic } draw_world(){ look at world settings (modified in update) make openGL calls to render world }

  26. FreeVR programming Subtleties • Rendering and updates occur in separate processes, so shared memory is needed. FreeVR includes vrShmemAlloc0 which is comparable to malloc. Typically a world data structure is created, modified, and passed around. • because of the separate processes we need to lock the world data when we are writing and reading it. FreeVR includes vrLock. We can call vrLockReadSet(the_lock); vrLockReadRelease(the_lock);

  27. 5) Applications –PDB viewer

  28. Virtual Vibraphone

  29. FreeVR Download http://www.freevr.org/ David J. Zielinski djzielin@duke.edu

More Related