111/22/2015 22:40 UML VRML 2.0 Scene Graph Structure Group Transformation Shape Nodes.

Slides:



Advertisements
Similar presentations
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 11 VRML Animation and Interaction.
Advertisements

17.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 17 – VRML: A Rough Guide.
3D sprog X3D: Et 3D sprog til at definere realtime 3D grafik der kan formidles via WWW. – XML integreret – Baseret på VRML – Relativt nyt så der findes.
VRML 97 Formato per la definizione di oggetti 3D. La versione VRML 1 viene da una semplificazione degli scene graphs di OpenInventor. La versione 2.0 (97)
Java3D Presented By Chris Gundlach
Event Routing §Some VRML nodes generate events in response to environmental changes or user interaction. Event routing gives authors a mechanism, separate.
Lecture21 Other Java Gamming technologies – Java3D (This lecture will not be assessed)
© Richard Jones, 2009 CO641 Computer Graphics 1 CO641 Computer Graphics and Animation X3d / VRML Richard Jones SW107
Viewpoint { eventIn SFBool set_bind exposedField SFFloat fieldOfView # (0,  ) exposedField SFBool jump TRUE exposedField SFRotation orientation.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 11 Animation F To understand the.
Introduction to VRML By Salman Yussof Diego Iglesias.
Adding Functionality To Web-Based VR Basic Concepts Client – server model Client-side static Client-side scripting Server-side scripting.
What Is VRML? VRML is: Stands for Virtual Reality Modeling Language A simple text language for describing 3-D shapes and interactive environments VRML.
Multimedia and the WWW Howell Istance and Chris Hand, Napier University.
Lecture22 Java3D - Interaction - This lecture will not be assessed.
An Overview of VRML §Scene Graph Structure VRML files describe 3D objects and worlds using a hierarchical scene graph. Entities in the scene graph are.
© De Montfort University, D Graphics and VRML Howell Istance and Chris Hand* De Montfort University * now at
A Standard Humanoid Representation on The Web: VRML/X3D Humanoid Animation Working Group (H-anim) Che-Jen Chen May/30/2003.
Java 3D Pablo Figueroa University of Alberta April 2000.
Cse591 Spring 981 VRML Basics The basic elements of VRML files are nodes. Every type of node has a set of fields associated with it. –Common single-valued.
Event Routing §Some VRML nodes generate events in response to environmental changes or user interaction. Event routing gives authors a mechanism, separate.
University College Dublin1 Scope ROOT Light SourceTransform Light SourceSphere.
3D on-line representations Jan Valcik → introduction, main idea → VRML 97 → building of virtual worlds → VRML 97 at work → X3D → MUDVR → animations, navigation.
Viewpoint and Animation Example: Bus. Sensors DEF BusTimer TimeSensor { cycleInterval 120 loop FALSE} DEF BusSensor ProximitySensor {center
VRML Virtual Reality Modeling Language. What Are We Going to See? What is VRML? Syntax of the language Features Examples.
Lahti International Week 2006 Introduction to X3D Lesson 2: Animating your models.
Spatial Sound in X3D/X3DOM Athanasios G. Malamos Multimedia Lab Dept. of Informatics Engineering TEI of Crete, Heraklion, Crete, Greece
Basic 3D Graphics Chapter 5. Bird’s Eye View  Basic 3D Graphics –Basic concepts of 3D graphics, rendering pipeline, Java 3D programming, scene graph,
Java ME & Blackberry APIs for Game Dev Week III. Overview Java 2D API Java 3D API SVG Blackberry APIs
, Computer Engineering Lab II (3rd Year)
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 3 – Object Definition in VRML.
VRML Dr. Alun Moon What is VRML The Virtual Reality Modeling Language (VRML) is a file format for describing interactive 3D objects.
Shapes Properties Binding Chung Ji Hye.
CS324e - Elements of Graphics and Visualization Checkerboard World.
Java3D Overview Scene graph Java 3D classes Describing objects Groups, transforms Behaviors, interpolators Lighting.
VRML - 1 Virtual Reality Modeling Language (VRML) Peter O’Grady.
H3D API Training  Part 3.3: Python – H3D integration.
VRML Shapes and Geometry
A Simple Talk on Java 3D Presented by C.H. Chen on Jul. 6, 2004.
VRML Scene Graphs. Learning Objectives Understand the concept of a scene graph Understand how VRML defines transformations (translations, rotations, and.
1 Virtual Reality Modeling Language (VRML97) ©Anthony Steed
1 VR assignment#2 WTK SDK Introduction By Jin-Bey Yu 2001/11/12.
CVVR National Dong Hwa Univ. 國立東華大學 VRML Virtual Reality Modeling Language
Computer Graphics Group Script node Jiří Žára. Computer Graphics Group Contents 1.Script node 2.Motion generators 2Script node.
H3D API Training Part 2.1: X3D. Outline  Scene graphs  X3D – XML syntax  X3D components overview.
Interactive Textures as Spatial User Interfaces in X3D Web3D 2010 Symposium Sabine Webel Y. Jung, M. Olbrich, T. Drevensek, T. Franke, M.Roth, D.Fellner,
VRML virtual reality modeling language. what is it? standardised (sort of) notation for virtual reality over the web text file (use normal text editor)
111/16/ :14 UML Instance Transformation x y z x y z x y z x y z SRT Model Coordinates.
H3D API Training Part 3.2: Fields; Event Handling.
Virtual Reality Modeling Language 97. What’s VRML? Virtual Reality Modeling Language 2D/3D graphics Audio:.wav,.mid Video: MPEG-1 Interactivity: time-
CS324e - Elements of Graphics and Visualization Java 3D Intro.
VRML Anthony Steed Department of Computer Science University College London ©Anthony Steed
X3D Extensible 3D (X3D) Part 1: Architecture and base components.
Interface Opportunities for 3D Data and Media User Interface Software TechNote Panel Virginia Tech CS Fall 2002 Nicholas F. Polys Umur Yilmaz Will Lee.
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 2 – Basic VRML.
Intro to VRML Let’s build something! The source code examples in this tutorial WORK!
1 9 Lighting a Scene v There are four types of lighting: –ambient light –directional light –point light –spotlight v Any number of these can be added to.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 11 Animation.
Virtual Reality Systems
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 5 Basic 3D Graphics.
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 6 – Texture Maps.
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 5 – Animation in VRML.
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 4 – Object Manipulation in VRML.
DLP for Virtual Environments (I)
MPEG-4 Binary Information for Scenes (BIFS)
Department of Computer Science University College London
VIRTUAL REALITY IN ROBOTICS
3D-Online Product Configuration by Java3D
VRML Shapes.
Lecture 3. Virtual Worlds : Representation,Creation and Simulation
Presentation transcript:

111/22/ :40 UML VRML 2.0 Scene Graph Structure Group Transformation Shape Nodes

211/22/ :40 UML Shape Node: Contained Nodes Shape Box Cone Cylinder Sphere Extrusion Text Point Set Indexed Line Set Indexed Face Set Elevation Grid FontStyleCoordinateColorNormal Texture Coordinate geometry Material Image, Movie PixelTexture Texture Transform Appearance appearance color coord color fontStyle normal texCoord material texture textureTransform

311/22/ :40 UML Text Node Definition fontStyle Node Definition Text { exposedField MFString string [] exposedField SFNode fontStyle NULL exposedField MFFloat length [] exposedField SFFloat maxExtent 0.0 } FontStyle { field MFString family “SERIF” field SFBool horizontal TRUE field MFString justify “BEGIN” field SFSring language ““ field SFFloat size 1.0 field SFFloat spacing 1.0 field SFString style “PLAIN” field SFBool topToBottom TRUE field SFBool leftToRight TRUE }

411/22/ :40 UML Appearance & Material Nodes Appearance { exposedField SFNode material NULL exposedField SFNode texture NULL exposedField SFNode textureTransform NULL } Material { exposedField SFFloat ambientIntensity 0.2 exposedField SFColor diffuseColor exposedField SFColor emissiveColor exposedField SFFloat shininess 0.2 exposedField SFColor specularColor exposedField SFFloat transparency 0 }

511/22/ :40 UML Texture Node Definitions ImageTexture { exposedField MFString url [] field SFBool repeatS TRUE feild SFBool repeatT TRUE } PixelTexture { exposedField SFImage image field SFBool repeatS TRUE feild SFBool repeatT TRUE }

611/22/ :40 UML Texture Node Definitions, Continued MovieTexture { exposedField SFBool loop FALSE exposedField SFFloat speed 1 exposedField SFTime startTime 0 exposedField SFTime stopTime 0 exposedField MFString url [] field SFBool repeatS TRUE field SFBool repeatT TRUE eventOut SFFloat duration_changed eventOut SFBool isActive }

711/22/ :40 UML Lighting in VRML 2.0 Directional Light Source DirectionalLight { exposedField SFFloat ambientIntensity 0 exposedField SFColor color exposedField SFVec3f direction exposedField SFFloat intensity 1 exposedField SFBool on TRUE } Directional lights are “scoped” to illuminate only objects in their group.

811/22/ :40 UML Lighting in VRML 2.0 Point Light Sources PointLight { exposedField SFFloat ambientIntensity 0 exposedField SFVec3f attenuation exposedField SFColor color exposedField SFFloat intensity 1 exposedField SFVec3f location exposedField SFBool on TRUE exposedField SFFloat radius 100 } Scoping for the PointLight is given by the radius field, beyond which no objects are illuminated

911/22/ :40 UML Lighting in VRML 2.0 Spotlights SpotLight { exposedField SFFloat ambientIntensity 0 exposedField SFVec3f attenuation exposedField SFFloat beamwidth exposedField SFColor color exposedField SFFloat cutOffAngle exposedField SFVec3f direction exposedField SFFloat intensity 1 exposedField SFVec3f location exposedField SFBool on TRUE exposedField SFFloat radius 100 }

1011/22/ :40 UML Transform Node Definition Transform { enventInMFNode addChildren eventInMFNode removeChildren exposedFieldSFVec3f center exposedFieldMFNode children [] exposedFieldSFRotation rotation exposedFieldSFVec3f scale exposedFieldSFRotation scaleOrientation exposedFieldSFVec3f translation fieldSFVec3f bboxCenter fieldSFVec3f bboxSize } Order of application: T(translation) T(rotation) T(scale) {children}

1111/22/ :40 UML GroupNode Definition Transform { enventInMFNode addChildren eventInMFNode removeChildren exposedFieldMFNode children [] fieldSFVec3f bboxCenter fieldSFVec3f bboxSize }

1211/22/ :40 UML Viewing in VRML 2.0 Viewpoint { eventIn SFBool set_bind exposedField SFFloat fieldOfView exposedField SFBool jump TRUE exposedField SFRotation orientation exposedField SFVec3f position field SFString description ““ eventOut SFTime bindTime eventOut SFBool isBound }

1311/22/ :40 UML Sound in VRML 2.0 Definition of Sound Node Sound { exposedField SFVec3f direction exposedField SFFloat intensity 1 exposedField SFVec3f location exposedField SFFloat maxBack 10 exposedField SFFloat maxFront 10 exposedField SFFloat minBack 1 exposedField SFFloat minFront 1 exposedField SFFloat priority 0 exposedField SFNode source NULL field SFBool spatialize TRUE }

1411/22/ :40 UML Sound in VRML2.0 Definition of AudioClip Node AudioClip { exposedField SFString description ““ exposedField SFBool loop FALSE exposedField SFFloat pitch 1.0 exposedField SFTime startTime 0 exposedField SFTime stopTime 0 exposedField MFString url [] eventOut duration_changed eventOut isActive }

1511/22/ :40 UML Spatial Sound Pattern in VRML 2.0 location minBack maxBack minFront maxFront Constant intensity Linear Attenuation direction

1611/22/ :40 UML Internode Communication: Events Node ANode B Node C eventOut eventIn Connection by a ROUTE

1711/22/ :40 UML Internode Communication Node Field Classes field Private node member exposedField Public node member eventIn Event received by node eventOut Event sent by node set_ Event received by node _changed Event sent by node Type and value of events correspond to type and value of node fields.

1811/22/ :40 UML Internode Communication Route Syntax DEF T1 Transform {... } DEF T2 Transform {... } DEF T3 Transform {... }... ROUTE T1.translation_changed TO T2.set_translation ROUTE T2.translation_changed TO T3.set_translation T1T2T3 translation

1911/22/ :40 UML Event Generators: Touch Sensor = Shapes Sensed

2011/22/ :40 UML Event Generators: Touch Sensor TouchSensor { exposedField SFBool enabled TRUE eventOut SFVec3f hitNormal_changed eventOut SFVec3f hitPoint_changed eventOut SFVec2f hitTexCoord_changed eventOut SFBool isActive eventOut SFBool isOver eventOut SFTime touchTime }

2111/22/ :40 UML Touch Sensor Example Group { children [ DEF TS TouchSensor { } Shape { appearance Appearance { material Material { diffuseColor } geometry Sphere {} } DEF Highlight DirectionalLight { color on FALSE } DEF ActiveLight DirectionalLight { color on FALSE } ] ROUTE TS.isOver TO Highlight.set_on ROUTE TS.isActive TO ActiveLight.set_on }

2211/22/ :40 UML Touch Sensor Example Group { children [ DEF TS TouchSensor { } Shape { appearance Appearance { material Material { diffuseColor } geometry Sphere {} } Sound { maxBack 1000 maxFront 1000 source DEF Audio AudioClip { url “horse.wav” } ] ROUTE TS.touchTime TO Audio.startTime }

2311/22/ :40 UML Adding Behavior to Objects TimeSensorInterpolatorGeneral Node [0,1] ScalarInterpolator PositionInterpolator OrientationInterpolator CoordinateInterpolator ColorInterpolator Maps [0,1] to field data type values. Generates time vary- ing scalar in range [0,1]

2411/22/ :40 UML Time Sensor TimeSensor { exposedField SFTime cycleInterval 1 exposedField SFBool enabled TRUE exposedField SFBool loop FALSE exposedField SFTime startTime 0 exposedField SFTime stopTime 0 eventOut SFTime cycleTime eventOut SFFloat fraction_changed eventOut SFBool isActive eventOut SFTime time } loop=TRUE loop=FALSE startTimestopTimecycleInterval

2511/22/ :40 UML Position Interpolator PositionInterpolator { eventIn SFFloat set_fraction exposedField MFFloat key [] exposedField MFVec3f keyValue [] eventOut SFVec3f value_changed } y z x Input: [ 0 1 ]

2611/22/ :40 UML Position Animation Example Def T Transform { translation children [ Shape { geometry Cone {} appearance Appearance { material Material { diffuseColor } ] } Def P PositionInterpolator { key [0, 0.5, 1] keyValue [ 0 0 0, 4 0 0, 0 0 0] } Def TS TimeSensor { stopTime -1 loop TRUE } ROUTE TS.fraction_changed TO P.set_fraction ROUTE P.value_changed TO T.set_translation

2711/22/ :40 UML Java 3D: Class Hierarchy

2811/22/ :40 UML Java 3D: Viewing Classes Locates a view within scene Contains most of view state Contains information about physical screen 3D version of Abstract Windowing Toolkit

2911/22/ :40 UML Java 3D: Sample Code to Build Scene Graph Shape3D myShape1 = new Shape3D(myGeometry1, myAppearance1); Shape3D myShape2 = new Shape3D(myGeometry2, myAppearance2); BranchGroup myBranch = new BranchGroup(); myBranch.addChild(myShape1); myBranch.addChild(myShape2); myBranch.compile(); VirtualUniverse myUniverse = new VirtualUniverse(); Locale myLocale = new Locale(myUniverse); myLocale.addBranchGraph(myBranch);

3011/22/ :40 UML Java 3D: Scene Graph Built

3111/22/ :40 UML Java 3D; Node Class Hierarchy

3211/22/ :40 UML Java 3D “Hello Universe” Program public class HelloUniverse extends Applet { public BranchGroup createSceneGraph() { // Create the root of the branch graph BranchGroup objRoot = new BranchGroup(); // Create the TransformGroup node and initialize it to the // identity. Enable the TRANSFORM_WRITE capability so that // our behavior code can modify it at run time. Add it to // the root of the subgraph. TransformGroup objTrans = new TransformGroup(); objTrans.setCapability( TransformGroup.ALLOW_TRANSFORM_WRITE); objRoot.addChild(objTrans); // Create a simple Shape3D node; add it to the scene graph. objTrans.addChild(new ColorCube(0.4)); // Create a new Behavior object that will perform the // desired operation on the specified transform and add // it into the scene graph.

3311/22/ :40 UML Java 3D “Hello Universe” Program, contd. Transform3D yAxis = new Transform3D(); Alpha rotationAlpha = new Alpha(-1, 4000); RotationInterpolator rotator = new RotationInterpolator( rotationAlpha, objTrans, yAxis, 0.0f, (float) Math.PI*2.0f); BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0); rotator.setSchedulingBounds(bounds); objRoot.addChild(rotator); // Have Java 3D perform optimizations on this scene graph. objRoot.compile(); return objRoot; } public HelloUniverse() { // Create the scene; attach it to the virtual universe BranchGroup scene = createSceneGraph(); SimpleUniverse u = new SimpleUniverse(canvas3d); u.getViewingPlatform().setNominalViewingTransform(); u.addBranchGraph(scene); }