Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Creating Virtual Reality Applications Using FreeVR David J. Zielinski Friday Visualization Forum October 1 st,2004."— Presentation transcript:

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

2 Overview 1) What is Virtual Reality? 2) What are my choices? 3) Why use FreeVR? 4) FreeVR program outline 5) 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? A) Write from scratch B) Low-level library C) Medium-level library (scenegraph) D) High-level graphical program E) 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 ● 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 ● 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 ● 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


Download ppt "Creating Virtual Reality Applications Using FreeVR David J. Zielinski Friday Visualization Forum October 1 st,2004."

Similar presentations


Ads by Google