Presentation is loading. Please wait.

Presentation is loading. Please wait.

111/16/2015 07:14 UML Instance Transformation x y z x y z x y z x y z SRT Model Coordinates.

Similar presentations


Presentation on theme: "111/16/2015 07:14 UML Instance Transformation x y z x y z x y z x y z SRT Model Coordinates."— Presentation transcript:

1 111/16/2015 07:14 UML Instance Transformation x y z x y z x y z x y z SRT Model Coordinates

2 211/16/2015 07: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

3 311/16/2015 07:14 UML Example of a Linked Structure: Robot Arm    y y y xxx z z z

4 411/16/2015 07:14 UML Moving Robot Components and Frames h1 h2

5 511/16/2015 07: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(); }

6 611/16/2015 07: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(); }

7 711/16/2015 07: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

8 811/16/2015 07: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

9 911/16/2015 07: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.

10 1011/16/2015 07:14 UML Scene Graphs Scene Translate Rotate Object 1 Object 2 Object 4 Object 3

11 1111/16/2015 07:14 UML Scene Graphs Traversing the Graph glPushMatrix(); glTranslate(...); glRotate(..._; Object1(); glPopMatrix(); glPushMatrix(); glTranslate(...); Object2(); glPopMatrix(); glPushMatrix(); glTranslate(...); glRotate(...); Object3(); glPopMatrix(); glPush Matrix(); Object4();

12 1211/16/2015 07: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

13 1311/16/2015 07:14 UML VRML Design Goals 0 Composability 0 Scalability 0 Extensibility 0 Simple authoring

14 1411/16/2015 07:14 UML VRML 2.0 Scene Graph Structure Group Transformation Shape Nodes

15 1511/16/2015 07: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

16 1611/16/2015 07: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

17 1711/16/2015 07: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

18 1811/16/2015 07: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

19 1911/16/2015 07: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.

20 2011/16/2015 07: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

21 2111/16/2015 07: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.

22 2211/16/2015 07:14 UML VRML 2.0 Box Definition Box { field SFVec3f size 2 2 2 } The Box node specifies a rectangular box in the local coordinate system centered at 0,0,0 and aligned with coordinate axes.

23 2311/16/2015 07: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 }

24 2411/16/2015 07: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.

25 2511/16/2015 07: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.

26 2611/16/2015 07: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 0.8 0.8 0.8 exposedField SFColor emissiveColor 0 0 0 exposedField SFFloat shininess 0.2 exposedField SFColor specularColor 0 0 0 exposedField SFFloat transparency 0 }

27 2711/16/2015 07:14 UML VRML 2.0 Transform Node Definition Transform { enventInMFNode addChildren eventInMFNode removeChildren exposedFieldSFVec3f center 0 0 0 exposedFieldMFNode children [] exposedFieldSFRotation rotation 0 0 1 0 exposedFieldSFVec3f scale 1 1 1 exposedFieldSFRotation scaleOrientation 0 0 1 0 exposedFieldSFVec3f translation 0 0 0 fieldSFVec3f bboxCenter 0 0 0 fieldSFVec3f bboxSize -1 -1 -1 } Order of application: T(translation) T(rotation) T(scale) {children}


Download ppt "111/16/2015 07:14 UML Instance Transformation x y z x y z x y z x y z SRT Model Coordinates."

Similar presentations


Ads by Google