111/16/ :14 UML Instance Transformation x y z x y z x y z x y z SRT Model Coordinates
211/16/ :14 UML Instancing in OpenGL glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(...); glRotate(...); glScale(...); glutSolidCylinder(...); /*or some other symbol*/ SymbolScaleRotateTranslate Cylinder sx, sy, sz x, y, z dx,dy,dz Cylinder... Sphere Tabular Representation
311/16/ :14 UML Example of a Linked Structure: Robot Arm y y y xxx z z z
411/16/ :14 UML Moving Robot Components and Frames h1 h2
511/16/ :14 UML Robot Construction display() { glRotate(theta, 0.0, 1.0, 0.0); base(); glTranslatef(0.0, h1, 0.0); glRotatef(phi, 0.0, 0.0, 1.0); lower_arm(); glTranslatef(0.0, h2, 0.0); glRotatef(psi, 0.0, 0.0, 1.0); upper_arm(); }
611/16/ :14 UML Hierarchical Structure Base Lower Arm Upper Arm * Draw Func. Transform * Child(ren) display() { glRotate(theta, 0.0, 1.0, 0.0); base(); glTranslatef(0.0, h1, 0.0); glRotatef(phi, 0.0, 0.0, 1.0); lower_arm(); glTranslatef(0.0, h2, 0.0); glRotatef(psi, 0.0, 0.0, 1.0); upper_arm(); }
711/16/ :14 UML Tree Representation of More Complex Robot Torso Head Left Upper Arm Right Upper Arm Left Upper Leg Right Upper Leg Left Lower Arm Right Lower Arm Left Lower Leg Right Lower Leg
811/16/ :14 UML Tree with Transformations Torso Head Left Upper Arm Right Upper Arm Left Upper Leg Right Upper Leg Left Lower Arm Right Lower Arm Left Lower Leg Right Lower Leg ThTluaTruaTlulTrul TllaTrlaTlllTrll
911/16/ :14 UML Traversing the Tree Torso Head Left Upper Arm Right Upper Arm Left Upper Leg Right Upper Leg Left Lower Arm Right Lower Arm Left Lower Leg Right Lower Leg ThTluaTruaTlulTrul TllaTrlaTlllTrll figure() { Torso(); glPushMatrix(); glTranslatef(...); glRotatef(...); Head(); glPopMatrix(...); glPushMatrix(...); glTranslatef(...); glRotatef(...); LeftUpperArm(); glTranslatef(...); glRotatef(...); LeftLowerArm(); glPopMatrix(...); glPushMatrix(...); glTranslatef(...); glRotatef(...); RightUpperArm(); glTranslatef(...); glRotatef(...); RightLowerArm(); T TTh T TTua TTuaTlla T TTrua TTruaTrla Current Transform.
1011/16/ :14 UML Scene Graphs Scene Translate Rotate Object 1 Object 2 Object 4 Object 3
1111/16/ :14 UML Scene Graphs Traversing the Graph glPushMatrix(); glTranslate(...); glRotate(..._; Object1(); glPopMatrix(); glPushMatrix(); glTranslate(...); Object2(); glPopMatrix(); glPushMatrix(); glTranslate(...); glRotate(...); Object3(); glPopMatrix(); glPush Matrix(); Object4();
1211/16/ :14 UML Architecture for Graphics on the Internet ModelApplicationAPI Graphics Pipeline Display UI TCP/IP Server TCP/IP Model Graphics Pipeline Graphics Pipeline UI Display Browser Network/Internet
1311/16/ :14 UML VRML Design Goals 0 Composability 0 Scalability 0 Extensibility 0 Simple authoring
1411/16/ :14 UML VRML 2.0 Scene Graph Structure Group Transformation Shape Nodes
1511/16/ :14 UML VRML 2.0 Node Format Node_Name { field_name field_value. field_name field_value } Each field has an associated class and type. Field class is one of: field, exposedfield, eventIn, enventOut
1611/16/ :14 UML VRML 2.0 Field Types SFBoolThe Boolean value TRUE or FALSE SFFloatA 32-bit floating point value SFInt32A 32-bit signed integer SFTimeAn absolute or relative time value SFVec2fA pair of floating point values, usually used to represent texture coordinates SFVec3fThree floating point values, usually used to represent a 3D position SFColorThree floating point values between zero and one, used to represent RGB SFRotationFour floating point values. The first three represent an axis, the fourth an angle
1711/16/ :14 UML VRML 2.0 Field Types SFImageA two-dimensional image with one to four color components SFStringA UTF8 (international character) string SFNodeA container for another VRML node MFFloatAn array of SFFloat values MFInt32An array of SFInt32 values MFVec2fAn array of SFVec2f values MFVec3f An array of SFVec3f values MFColorAn array of SFColor values MFRotationAn array of SFRotation values MFStringAn array of SFString values
1811/16/ :14 UML VRML 2.0 Composing Node Hierarchies Node_name_1 { field_name field_value field_name Node_name_2 { field_name field_value } field_name Node_name_3 { field_name field_value } 1 23
1911/16/ :14 UML VRML 2.0 The Shape Node Definition Shape { exposedField SFNode appearance NULL exposedField SFNode geometry NULL } Node Name Field ClassField Type Field Name Default Value Bold values are what is actually typed in source file.
2011/16/ :14 UML VRML 2.0 Geometry Nodes 0 Predefined shapes -Cone -Box -Cylinder -Sphere 0 PointSet 0 IndexedLineSet (polyline) 0 IndexedFaceSet (polygonal object) 0 ElevationGrid 0 Extrusion 0 Text
2111/16/ :14 UML VRML 2.0 Cone Definition Cone { field SFFloat bottomRadius 1 field SFFloat height2 field SfBool sideTRUE field SFBool bottomTRUE } The Cone node specifies a cone centered in the local coordinate system and whose axis is aligned with the local y axis. The Boolean fields define whether the sides or bottom of the cone are visible. All dimensions are in meters.
2211/16/ :14 UML VRML 2.0 Box Definition Box { field SFVec3f size } The Box node specifies a rectangular box in the local coordinate system centered at 0,0,0 and aligned with coordinate axes.
2311/16/ :14 UML VRML 2.0 Cylinder Definition Cylinder { field SFBool bottom TRUE field SFFloat height 2 field SFFloat radius 1 field SFBool side TRUE field SFBool top TRUE } Sphere Definition Sphere { field SFFloat radius 1 }
2411/16/ :14 UML VRML 2.0 Indexed Face Set - Partial Definition IndexedFaceSet { exposedField SFNode coord NULL field SFBool ccw TRUE field SFBool convex TRUE field MFInt32 coordIndex [] field SFBool solid TRUE... } Coordinate { exposedField MFVec3f point [] } There are 13 other fields in IndexedFaceSet, making it the most complex and flexible node in VRML.
2511/16/ :14 UML VRML 2.0 Simplest Possible World Shape{ geometry Cone { } } Shape Node Geometry Field Cone node has no fields: accept all default values. Shape node has no appearance field: accept all white.
2611/16/ :14 UML VRML 2.0 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 }
2711/16/ :14 UML VRML 2.0 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}