+ All Categories
Home > Documents > A Taste of Virtual Environment Development - SVE

A Taste of Virtual Environment Development - SVE

Date post: 02-Jan-2016
Category:
Upload: plato-benton
View: 41 times
Download: 2 times
Share this document with a friend
Description:
A Taste of Virtual Environment Development - SVE. Amy Ulinski Raj Inugala. Overview. What are Virtual Environments? Displays What is SVE? Steps to making first SVE program Demo Example Fun things you can do. What are Virtual Environments?. Modeling. Displays. Displays cont…. - PowerPoint PPT Presentation
Popular Tags:
22
A Taste of Virtual Environment Development - SVE Amy Ulinski Raj Inugala
Transcript
Page 1: A Taste of Virtual Environment Development - SVE

A Taste of Virtual Environment Development - SVE

Amy Ulinski

Raj Inugala

Page 2: A Taste of Virtual Environment Development - SVE

Overview

• What are Virtual Environments?

• Displays

• What is SVE?

• Steps to making first SVE program

• Demo Example

• Fun things you can do

Page 3: A Taste of Virtual Environment Development - SVE

What are Virtual Environments?

Page 4: A Taste of Virtual Environment Development - SVE

Modeling

Page 5: A Taste of Virtual Environment Development - SVE

Displays

Page 6: A Taste of Virtual Environment Development - SVE

Displays cont…

Page 7: A Taste of Virtual Environment Development - SVE

What is SVE?

• Simple Virtual Environment library– Easy creation of simple Virtual Environment

(VE) applications– Provide system of functions, event handlers

and 3D description of a Virtual World – Allows use of devices– Device-independent

Page 8: A Taste of Virtual Environment Development - SVE

Scene Graph

World

Table

UserRoom

Chair

•Nodes contain information about geometry, appearance, behavior, etc. of objects.

•Place Holder Objects

•Edges between nodes usually represent coordinate transformations between two coordinate systems

Page 9: A Taste of Virtual Environment Development - SVE

Scene Graph of an Environment

Room

Door Table Chair

Vase

Page 10: A Taste of Virtual Environment Development - SVE

Different Types of Representation

Table top

LegLeg Leg

LegTable top

Leg Leg Leg

Leg

TableVase

What happens to the table if you move a leg?

What happens to the table if you move the vase?

What happens to the vase if you move the table?

Page 11: A Taste of Virtual Environment Development - SVE

Don’t Call Us… We’ll Call You

• App initializes SVE system • Registers “callback” • Sve system gains control again

Page 12: A Taste of Virtual Environment Development - SVE

My First SVE Program

• Create an environment (3DS Max, Maya, Bryce, etc…)

• Export a .obj and .mtl file– Some software will convert for you

ie. Deep Explorations

Page 13: A Taste of Virtual Environment Development - SVE

.objmtllib office4.mtl

# object floor g floor v 3.95775e-005 -0.00473949 -0.00475565 v 4.20004 -0.00473949 -0.00475565

v 3.95775e-005 -0.00473922 -4.50476 v 4.20004 -0.00473922 -4.50476 v 3.95775e-005 0.00526051 -0.00475565 v 4.20004 0.00526051 -0.00475565 v 3.95775e-005 0.00526077 -4.50476 v 4.20004 0.00526077 -4.50476 # 8 verticies vt 1 0 vt 1 1 vt 0 1 vt 0 0

# 4 texture verticies vn 0 -1 -5.96046e-008 vn 0 1 5.96046e-008 vn 0 -4.65661e-008 1 vn 1 -3.94746e-014 0 vn 1 0 0 vn 1 -7.89492e-014 0 vn 0 0 -1 vn -1 0 0 # 8 normals usemtl Fabric_Blue_Carpet f 1/1/1 3/2/1 4/3/1 2/4/1 f 5/4/2 6/1/2 8/2/2 7/3/2 f 1/4/3 2/1/3 6/2/3 5/3/3 f 2/4/4 4/1/5 8/2/4 6/3/6 f 4/4/7 3/1/7 7/2/7 8/3/7 f 3/4/8 1/1/8 5/2/8 7/3/8

Page 14: A Taste of Virtual Environment Development - SVE

.mtl

newmtl Fabric_Blue_Carpet Ka 0 0 0 Kd 0.231373 0.231373 0.392157 Ks 0.9 0.9 0.9 illum 2 Ns 2.14355 map_Kd Carptblu.bmp map_bump Carptblu.bmp bump Carptblu.bmp

Page 15: A Taste of Virtual Environment Development - SVE

.worldSimple Virtual Object File Format version 2.0

object: meadow

description file: hello_world.objmove to 0 0 0children {

object: floor description file: myfloor.obj scale by 1.1 along y move to 0.0 0.5 -3.0

}

Page 16: A Taste of Virtual Environment Development - SVE

Loading World into SVE#include "sve.h"

main(int argc, char *argv[]) {

  SVE_config config = SVE_NORMAL; //setting the configuration to normal

SVE_init("Example1 (sve)", config, &argc, argv); //initializes SVE system

if(!SVE_loadWorld(“example1.world")){   SVE_done(); //quit SVE}

SVE_beginEventLoop(); //SVE system gains control of program

SVE_done();

}

Page 17: A Taste of Virtual Environment Development - SVE

Simple Example

• demo

Page 18: A Taste of Virtual Environment Development - SVE

Manipulating Objects

• Must locate object in object treeSVE_object cube = SVE_findWorldObject("cube");

• Examples:

SVE_rotateObject(cube, 3, 'y');

SVE_changeObjectName(cube,"cube3");

SVE_setNewObjectPosition(cube,newPosition);

SVE_translateObjectGlobal(cube,0.2,0.4,0.5);

SVE_scaleObject(cube, 0.1, 0.0,0.0);

Page 19: A Taste of Virtual Environment Development - SVE

LIGHTINGSimple Virtual Primitive File Format version 1.1number of components: 2

component 1 type: lightData of component 1:no of attributes:3color 0.8 0.8 0.8local-light TRUEposition 10.0 10.0 10.0

component 2 type: lightData of component 2:no of attributes:2color 0.8 0.8 0.8position 0.0 1.0 0.0

Page 20: A Taste of Virtual Environment Development - SVE

SOUND

• Open Sound– int sound =

SVE_audioOpenSound("belltree_up2.wav");

• Play Sound– SVE_audioReplaySound(sound, TRUE);– SVE_audioStopSound(sound);

Page 21: A Taste of Virtual Environment Development - SVE

MORE DEMOS…

Page 22: A Taste of Virtual Environment Development - SVE

Questions ???


Recommended