Presentation is loading. Please wait.

Presentation is loading. Please wait.

© TMC Computer School HC20203 VRML 4 - 1 HIGHER DIPLOMA IN COMPUTING Chapter 4 – Object Manipulation in VRML.

Similar presentations


Presentation on theme: "© TMC Computer School HC20203 VRML 4 - 1 HIGHER DIPLOMA IN COMPUTING Chapter 4 – Object Manipulation in VRML."— Presentation transcript:

1 © TMC Computer School HC20203 VRML 4 - 1 HIGHER DIPLOMA IN COMPUTING Chapter 4 – Object Manipulation in VRML

2 © TMC Computer School HC20203 VRML 4 - 2 HIGHER DIPLOMA IN COMPUTING Understanding Coordinate System  VRML defines the unit of measure of the world coordinate system to be metres  All other coordinate systems are built from transformations based from the world coordinate system  The VRML convention that one unit equals one meter  In VRML, we can create any number of coordinate systems

3 © TMC Computer School HC20203 VRML 4 - 3 HIGHER DIPLOMA IN COMPUTING Understanding Coordinate System  Each new coordinate system is positioned or translated relative to the origin of another coordinate system  When a new coordinate system is relative to another, we say that the new coordinate system is a child coordinate system that is nested within the within the parent coordinate system  The entire family tree of coordinate systems including any shape we build within those coordinate system is called the scene graph

4 © TMC Computer School HC20203 VRML 4 - 4 HIGHER DIPLOMA IN COMPUTING Understanding Coordinate System  Try to visualize the coordinate system as indicated in the diagram below

5 © TMC Computer School HC20203 VRML 4 - 5 HIGHER DIPLOMA IN COMPUTING Understanding Coordinate System  The ability to create coordinate systems is a very powerful feature of VRML  Consider the steps in placing the lamp on the table while the table is inside a room  We need to perform the following steps:  Create a lamp, building each of its components relative to a lamp coordinate system  Create a table, building each of its components relative to a table coordinate system

6 © TMC Computer School HC20203 VRML 4 - 6 HIGHER DIPLOMA IN COMPUTING Understanding Coordinate System  Place the lamp on the table by positioning the lamp coordinate system relative to the table coordinate system  Now the lamp coordinate system is a child of the table coordinate system  Create a room, building each of its components relative to a room coordinate system  Place the table (and its lamp) by positioning the table coordinate system relative to the room coordinate system

7 © TMC Computer School HC20203 VRML 4 - 7 HIGHER DIPLOMA IN COMPUTING Translating and Grouping Coordinate Systems  We need to use a Transform node to create a new coordinate system and specify the position or translation relative to a parent coordinate system  The Transform node is similar to the Group node in that it contains a list of child nodes  These child nodes could be Shape node, Group node or Transform nodes  All of the child nodes are built at the origin within the Transform node’s coordinate system

8 © TMC Computer School HC20203 VRML 4 - 8 HIGHER DIPLOMA IN COMPUTING Translating and Grouping Coordinate Systems  All of the child nodes are built at the origin within the Transform node’s coordinate system  If the position of that node changes, all its child nodes will change accordingly with the changed coordinate system  Like Shape and Group nodes, the Transform node may be the child of a parent Group or Transform node

9 © TMC Computer School HC20203 VRML 4 - 9 HIGHER DIPLOMA IN COMPUTING Translating and Grouping Coordinate Systems  The coordinate system of the parent node is the parent coordinate system of the Transform node coordinate system  If the root node is a Transform node, then the parent coordinate system is the world coordinate system of the VRML file

10 © TMC Computer School HC20203 VRML 4 - 10 HIGHER DIPLOMA IN COMPUTING The Transform Node  The Transform node creates a new coordinate system relative to its parent node coordinate system Transform { children [ ]# exposedField MFNode translation0.0 0.0 0.0# exposedFieldSFVec3f rotation0.0 0.0 1.0 0.0# exposedFieldSFRotation scale1.0 1.0 1.0# exposedFieldSFVec3f scaleOrientation0.0 0.0 1.0 0.0# exposedFieldSFRotation bboxCenter0.0 0.0 0.0# fieldSFVec3f bboxSize-1.0 -1.0 -1.0# fieldSFVec3f center0.0 0.0 0.0# exposedFieldSFVec3f addChildren# eventInMFNode removeChildren# eventOutMFNode }

11 © TMC Computer School HC20203 VRML 4 - 11 HIGHER DIPLOMA IN COMPUTING The Transform Node  The value of the children exposed field specifies a list of child nodes to be included in the group  Typical values in the children are the Shape nodes, Group nodes and Transform nodes  The value of the translation exposed field specify the distances in X, Y, Z directions  The value of the translation exposed field can be changed by routing an event to the exposed field’s implied set_translation eventIn.  When the event is received, the translation field is set and the new translation is sent using the exposed field’s implied translation_changed eventOut.

12 © TMC Computer School HC20203 VRML 4 - 12 HIGHER DIPLOMA IN COMPUTING Translating 2.0 units along x-axis and building Cylinder #VRML V2.0 utf8 Transform { translation 2.0 0.0 0.0 children [ Shape { appearance Appearance { material Material { } } geometry Cylinder { } } ] }

13 © TMC Computer School HC20203 VRML 4 - 13 HIGHER DIPLOMA IN COMPUTING Translating -2.0 units along x-axis and building Cylinder #VRML V2.0 utf8 Transform { translation -2.0 0.0 0.0 children [ Shape { appearance Appearance { material Material { } } geometry Cylinder { } } ] }

14 © TMC Computer School HC20203 VRML 4 - 14 HIGHER DIPLOMA IN COMPUTING Translating 2.0 units along y-axis and building Cylinder #VRML V2.0 utf8 Transform { translation 0.0 2.0 0.0 children [ Shape { appearance Appearance { material Material { } } geometry Cylinder { } } ] }

15 © TMC Computer School HC20203 VRML 4 - 15 HIGHER DIPLOMA IN COMPUTING Translating 2.0 units along z-axis and building Cylinder #VRML V2.0 utf8 Transform { translation 0.0 0.0 2.0 children [ Shape { appearance Appearance { material Material { } } geometry Cylinder { } } ] }

16 © TMC Computer School HC20203 VRML 4 - 16 HIGHER DIPLOMA IN COMPUTING Translating along x-, y-, z-axis and building Cylinder #VRML V2.0 utf8 Transform { translation 2.0 1.0 -2.0 children [ Shape { appearance Appearance { material Material { } } geometry Cylinder { } } ] }

17 © TMC Computer School HC20203 VRML 4 - 17 HIGHER DIPLOMA IN COMPUTING Building Shapes in Multiple Coordinate Systems #VRML V2.0 utf8 Group { children [ # Draw the hut walls Shape { appearance DEF White Appearance { material Material { } } geometry Cylinder { height 2.0 radius 2.0 } },

18 © TMC Computer School HC20203 VRML 4 - 18 HIGHER DIPLOMA IN COMPUTING Building Shapes in Multiple Coordinate Systems # Draw the hut roof Transform { translation 0.0 2.0 0.0 children [ Shape { appearance USE White geometry Cone { height 2.0 bottomRadius 2.5 } ] } ] }

19 © TMC Computer School HC20203 VRML 4 - 19 HIGHER DIPLOMA IN COMPUTING Constructing Multiple Coordinate Systems #VRML V2.0 utf8 Group { children [ # Ground Shape { appearance DEF White Appearance { material Material { } } geometry Box { size 25.0 0.1 25.0 } },

20 © TMC Computer School HC20203 VRML 4 - 20 HIGHER DIPLOMA IN COMPUTING Constructing Multiple Coordinate Systems # Left Column Transform { translation -2.0 3.0 0.0 children Shape { appearance USE White geometry Cylinder { radius 0.3 height 6.0 } },

21 © TMC Computer School HC20203 VRML 4 - 21 HIGHER DIPLOMA IN COMPUTING Constructing Multiple Coordinate Systems # Right Column Transform { translation 2.0 3.0 0.0 children Shape { appearance USE White geometry Cylinder { radius 0.3 height 6.0 } },

22 © TMC Computer School HC20203 VRML 4 - 22 HIGHER DIPLOMA IN COMPUTING Constructing Multiple Coordinate Systems # Archway span Transform { translation 0.0 6.05 0.0 children Shape { appearance USE White geometry Box { size 4.6 0.4 0.6 } ] }

23 © TMC Computer School HC20203 VRML 4 - 23 HIGHER DIPLOMA IN COMPUTING Nesting Coordinate Systems #VRML V2.0 utf8 Group { children [ # Ground Shape { appearance DEF White Appearance { material Material { } } geometry Box { size 25.0 0.1 25.0 } },

24 © TMC Computer School HC20203 VRML 4 - 24 HIGHER DIPLOMA IN COMPUTING Nesting Coordinate Systems # First archway # Left Column DEF LeftColumn Transform { translation -2.0 3.0 0.0 children DEF Column Shape { appearance USE White geometry Cylinder { radius 0.3 height 6.0 } },

25 © TMC Computer School HC20203 VRML 4 - 25 HIGHER DIPLOMA IN COMPUTING Nesting Coordinate Systems # Right Column DEF RightColumn Transform { translation 2.0 3.0 0.0 children USE Column }, # Archway span DEF ArchwaySpan Transform { translation 0.0 6.05 0.0 children Shape { appearance USE White geometry Box { size 4.6 0.4 0.6 } },

26 © TMC Computer School HC20203 VRML 4 - 26 HIGHER DIPLOMA IN COMPUTING Nesting Coordinate Systems # Second archway Transform { translation 0.0 0.0 -2.0 children [ USE LeftColumn, USE RightColumn, USE ArchwaySpan ] } ] }

27 © TMC Computer School HC20203 VRML 4 - 27 HIGHER DIPLOMA IN COMPUTING Rotating Shapes  In order to make the object more realistic, we must also control the orientation or rotation using the rotation field of the Transform node  A rotation axis is an imaginary line about which a coordinate system in rotated  A rotation axis can point to any direction in space  In order to specify a direction for a rotation axis, one could imagine drawing a line between two coordinates in space

28 © TMC Computer School HC20203 VRML 4 - 28 HIGHER DIPLOMA IN COMPUTING Rotating Shapes  Usually, one coordinate corresponds to the origin. Therefore in specifying a rotation axis, (0, 1.0, 0) and (0, 2.0, 0) are all equivalent as they all point upwards  In addition to specifying a rotation axis, we must also indicate how much we want the new coordinate system to rotate about that axis and this value is measured in radian  By default, the centre of rotation is the origin of that coordinate system

29 © TMC Computer School HC20203 VRML 4 - 29 HIGHER DIPLOMA IN COMPUTING Rotating Shapes  Using the Transform node, we could specify the 3D coordinates for rotation centre within a new coordinate system Transform { children [ ]# exposedField MFNode translation0.0 0.0 0.0# exposedFieldSFVec3f rotation0.0 0.0 1.0 0.0# exposedFieldSFRotation scale1.0 1.0 1.0# exposedFieldSFVec3f scaleOrientation0.0 0.0 1.0 0.0# exposedFieldSFRotation bboxCenter0.0 0.0 0.0# fieldSFVec3f bboxSize-1.0 -1.0 -1.0# fieldSFVec3f center0.0 0.0 0.0# exposedFieldSFVec3f addChildren# eventInMFNode removeChildren# eventOutMFNode }

30 © TMC Computer School HC20203 VRML 4 - 30 HIGHER DIPLOMA IN COMPUTING Rotating Shapes  The values of the rotation exposed field specify a rotation axis about which the new coordinate system and a rotation angle, measured in radian  The rotation exposed field value can be changed by routing an event to the exposed field’s implied set_rotation eventIn.  When the event is received, the rotation field is set and the new rotation is sent using the exposed field’s implied rotation_changed eventOut

31 © TMC Computer School HC20203 VRML 4 - 31 HIGHER DIPLOMA IN COMPUTING Rotating in Different Direction #VRML V2.0 utf8 Transform { rotation 1.0 0.0 0.0 0.785 children [ Shape { appearance Appearance { material Material { } } geometry Box { } } ] }

32 © TMC Computer School HC20203 VRML 4 - 32 HIGHER DIPLOMA IN COMPUTING Rotating in Different Direction #VRML V2.0 utf8 Transform { rotation 1.0 0.0 0.0 - 0.785 children [ Shape { appearance Appearance { material Material { } } geometry Box { } } ] }

33 © TMC Computer School HC20203 VRML 4 - 33 HIGHER DIPLOMA IN COMPUTING Rotating in Different Direction #VRML V2.0 utf8 Transform { rotation 0.0 1.0 0.0 0.785 children [ Shape { appearance Appearance { material Material { } } geometry Box { } } ] }

34 © TMC Computer School HC20203 VRML 4 - 34 HIGHER DIPLOMA IN COMPUTING Rotating in Different Direction #VRML V2.0 utf8 Transform { rotation 0.0 0.0 1.0 -0.785 children [ Shape { appearance Appearance { material Material { } } geometry Box { } } ] }

35 © TMC Computer School HC20203 VRML 4 - 35 HIGHER DIPLOMA IN COMPUTING Constructing Multiple Rotated Coordinate Systems #VRML V2.0 utf8 Group { children [ # Arm 1 DEF Arm1 Shape { appearance Appearance { material Material { } } geometry Cylinder { height 1.0 radius 0.1 } },

36 © TMC Computer School HC20203 VRML 4 - 36 HIGHER DIPLOMA IN COMPUTING Constructing Multiple Rotated Coordinate Systems # Arm 2 Transform { rotation 1.0 0.0 0.0 1.047 children USE Arm1 }, # Arm 3 Transform { rotation 1.0 0.0 0.0 2.094 children USE Arm1 } ] }

37 © TMC Computer School HC20203 VRML 4 - 37 HIGHER DIPLOMA IN COMPUTING Nesting Rotated Coordinate Systems #VRML V2.0 utf8 Group { children [ # Arm 1 DEF Arm1 Shape { appearance Appearance { material Material { } } geometry Cylinder { height 1.0 radius 0.1 } },

38 © TMC Computer School HC20203 VRML 4 - 38 HIGHER DIPLOMA IN COMPUTING Nesting Rotated Coordinate Systems # Arm 2 DEF Arm2 Transform { rotation 1.0 0.0 0.0 1.047 children USE Arm1 }, # Arm 3 DEF Arm3 Transform { rotation 1.0 0.0 0.0 2.094 children USE Arm1 },

39 © TMC Computer School HC20203 VRML 4 - 39 HIGHER DIPLOMA IN COMPUTING Nesting Rotated Coordinate Systems # Arms 4 and 5 Transform { rotation 0.0 1.0 0.0 1.785 children [ USE Arm2, USE Arm3 ] } ] }

40 © TMC Computer School HC20203 VRML 4 - 40 HIGHER DIPLOMA IN COMPUTING Translating and Rotating Coordinate Systems #VRML V2.0 utf8 Group { children [ # Ground Shape { appearance DEF White Appearance { material Material { } } geometry Box { size 25.0 0.1 25.0 } },

41 © TMC Computer School HC20203 VRML 4 - 41 HIGHER DIPLOMA IN COMPUTING Translating and Rotating Coordinate Systems # First archway # Left Column DEF LeftColumn Transform { translation -2.0 3.0 0.0 children DEF Column Shape { appearance USE White geometry Cylinder { radius 0.3 height 6.0 } },

42 © TMC Computer School HC20203 VRML 4 - 42 HIGHER DIPLOMA IN COMPUTING Translating and Rotating Coordinate Systems # Right Column DEF RightColumn Transform { translation 2.0 3.0 0.0 children USE Column }, # Archway span DEF ArchwaySpan Transform { translation 0.0 6.05 0.0 children Shape { appearance USE White geometry Box{ size 4.6 0.4 0.6 } },

43 © TMC Computer School HC20203 VRML 4 - 43 HIGHER DIPLOMA IN COMPUTING Translating and Rotating Coordinate Systems # Left Roof DEF LeftRoof Transform { translation -1.15 7.12 0.0 rotation 0.0 0.0 1.0 0.524 children DEF Roof Shape { appearance USE White geometry Box { size 2.86 0.4 0.6 } },

44 © TMC Computer School HC20203 VRML 4 - 44 HIGHER DIPLOMA IN COMPUTING Translating and Rotating Coordinate Systems # Right Roof DEF LeftRoof Transform { translation 1.15 7.12 0.0 rotation 0.0 0.0 1.0 -0.524 children USE Roof } ] }

45 © TMC Computer School HC20203 VRML 4 - 45 HIGHER DIPLOMA IN COMPUTING Rotating about a Center Point #VRML V2.0 utf8 Group{ children [ # Lamp base Shape { appearance DEF White Appearance { material Material { } } geometry Cylinder { radius 0.1 height 0.01 } },

46 © TMC Computer School HC20203 VRML 4 - 46 HIGHER DIPLOMA IN COMPUTING Rotating about a Center Point # Base joint Transform { translation 0.0 0.15 0.0 rotation 1.0 0.0 0.0 -0.7 center 0.0 -0.15 0.0 children [ # Lower arm Shape { appearance USE White geometry Cylinder { radius 0.01 height 0.3 } ] } ] }

47 © TMC Computer School HC20203 VRML 4 - 47 HIGHER DIPLOMA IN COMPUTING Scaling Shapes  VRML also enables us to scale a coordinate system, increasing or decreasing the size relative to a parent coordinate system  Shapes created within the scaled coordinate system are built at the new scale of the coordinate system  By scaling coordinate systems, we can enlarge or shrink shapes or groups of shapes  A scale factor is used in scaling and this scale factor is a multiplication factor.  If the value of this scale factor is 0.5, then the original object will shrink in size by half

48 © TMC Computer School HC20203 VRML 4 - 48 HIGHER DIPLOMA IN COMPUTING Scaling Shapes  The Transform node’s scale field uses three scale factors, one along the x-axis, one along the y-axis and one along the z-axis  By default, the centre of scaling is the original of that coordinate system  Now we could make use of the combination of translation, rotation and scaling within the same Transform node to achieve the effect that we want  The value of the scale exposed field specify the scale factors in the X, Y and Z directions for the new coordinate system

49 © TMC Computer School HC20203 VRML 4 - 49 HIGHER DIPLOMA IN COMPUTING Scaling Shapes  All the scale factors have to be a positive value  Values between 0.0 and 1.0 would imply reduction and values above 1.0 would imply expansion  The value of the scaleOrientation field specify a rotation axis and angle which to rotate the new coordinate system prior to scaling, and then unrotate if after scaling  Like the rotation field, the first values specify the X, Y and Z components of a 3D coordinate in the new, translated coordinate system and last value specifies the rotation angle measured in radian

50 © TMC Computer School HC20203 VRML 4 - 50 HIGHER DIPLOMA IN COMPUTING Scaling in Different Direction #VRML V2.0 utf8 Transform { scale 2.0 1.0 1.0 children [ Shape { appearance Appearance { material Material { } } geometry Sphere { } } ] }

51 © TMC Computer School HC20203 VRML 4 - 51 HIGHER DIPLOMA IN COMPUTING Scaling in Different Direction #VRML V2.0 utf8 Transform { scale 0.5 1.0 1.0 children [ Shape { appearance Appearance { material Material { } } geometry Sphere { } } ] }

52 © TMC Computer School HC20203 VRML 4 - 52 HIGHER DIPLOMA IN COMPUTING Scaling in Different Direction #VRML V2.0 utf8 Transform { scale 1.0 2.0 1.0 children [ Shape { appearance Appearance { material Material { } } geometry Sphere { } } ] }

53 © TMC Computer School HC20203 VRML 4 - 53 HIGHER DIPLOMA IN COMPUTING Scaling in Different Direction #VRML V2.0 utf8 Transform { scale 1.0 1.0 0.5 children [ Shape { appearance Appearance { material Material { } } geometry Sphere { } } ] }

54 © TMC Computer School HC20203 VRML 4 - 54 HIGHER DIPLOMA IN COMPUTING Scaling in Different Direction #VRML V2.0 utf8 Transform { scale 2.0 0.5 4.0 children [ Shape { appearance Appearance { material Material { } } geometry Sphere { } } ] }

55 © TMC Computer School HC20203 VRML 4 - 55 HIGHER DIPLOMA IN COMPUTING Constructing Multiple Scale Coordinate Systems #VRML V2.0 utf8 Group { children [ # Wing Transform { scale 0.5 1.0 1.5 children Shape { appearance DEF White Appearance { material Material { } } geometry Cylinder { radius 1.0 height 0.025 } },

56 © TMC Computer School HC20203 VRML 4 - 56 HIGHER DIPLOMA IN COMPUTING Constructing Multiple Scaled Coordinate Systems # Fuselage Transform { scale 2.0 0.2 0.5 children Shape { appearance USE White geometry Sphere { } } ] }

57 © TMC Computer School HC20203 VRML 4 - 57 HIGHER DIPLOMA IN COMPUTING Nesting Scaled Coordinate Systems #VRML V2.0 utf8 Group { children [ # Wing DEF Wing Transform { scale 0.5 1.0 1.5 children Shape { appearance DEF White Appearance { material Material { } } geometry Cylinder { radius 1.0 height 0.025 } },

58 © TMC Computer School HC20203 VRML 4 - 58 HIGHER DIPLOMA IN COMPUTING Nesting Scaled Coordinate Systems # Fuselage DEF Fusalage Transform { scale 2.0 0.2 0.5 children Shape { appearance USE White geometry Sphere { } } },

59 © TMC Computer School HC20203 VRML 4 - 59 HIGHER DIPLOMA IN COMPUTING Nesting Scaled Coordinate Systems # Wing detail and fusalage dome Transform { scale 0.3 2.0 0.75 children [ USE Wing, USE Fusalage ] } ] }

60 © TMC Computer School HC20203 VRML 4 - 60 HIGHER DIPLOMA IN COMPUTING Translating and Scaling Coordinate Systems #VRML V2.0 utf8 Group { children [ # Ground Shape { appearance DEF White Appearance { material Material { } } geometry Box { size 25.0 0.1 25.0 } },

61 © TMC Computer School HC20203 VRML 4 - 61 HIGHER DIPLOMA IN COMPUTING Translating and Scaling Coordinate Systems # First archway DEF Archway Group { children [ # Left Column DEF LeftColumn Transform { translation -2.0 3.0 0.0 children DEF Column Shape { appearance USE White geometry Cylinder { radius 0.3 height 6.0 } },

62 © TMC Computer School HC20203 VRML 4 - 62 HIGHER DIPLOMA IN COMPUTING Translating and Scaling Coordinate Systems # Right Column DEF RightColumn Transform { translation 2.0 3.0 0.0 children USE Column }, # Archway span DEF ArchwaySpan Transform { translation 0.0 6.05 0.0 children Shape { appearance USE White geometry Box { size 4.6 0.4 0.6 } },

63 © TMC Computer School HC20203 VRML 4 - 63 HIGHER DIPLOMA IN COMPUTING Translating and Scaling Coordinate Systems # Left Roof DEF LeftRoof Transform { translation -1.15 7.12 0.0 rotation 0.0 0.0 1.0 0.524 children DEF Roof Shape { appearance USE White geometry Box { size 2.86 0.4 0.6 } },

64 © TMC Computer School HC20203 VRML 4 - 64 HIGHER DIPLOMA IN COMPUTING Translating and Scaling Coordinate Systems # Right Roof DEF RightRoof Transform { translation 1.15 7.12 0.0 rotation 0.0 0.0 1.0 -0.524 children USE Roof } ] }, # Left small archway Transform { translation -4.0 0.0 0.0 scale 0.5 0.5 0.5 children USE Archway },

65 © TMC Computer School HC20203 VRML 4 - 65 HIGHER DIPLOMA IN COMPUTING Translating and Scaling Coordinate Systems # Right small archway Transform { translation 4.0 0.0 0.0 scale 0.5 0.5 0.5 children USE Archway } ] }

66 © TMC Computer School HC20203 VRML 4 - 66 HIGHER DIPLOMA IN COMPUTING Scaling about a Center Point #VRML V2.0 utf8 Group { children [ # Ground Shape { appearance DEF White Appearance { material Material { } } geometry Box { size 12.0 0.1 12.0 } },

67 © TMC Computer School HC20203 VRML 4 - 67 HIGHER DIPLOMA IN COMPUTING Scaling about a Center Point # Tree Transform { translation 0.0 1.0 0.0 scale 1.0 1.0 1.0 center 0.0 -1.0 0.0 children [ # Trunk Shape { appearance USE White geometry Cylinder { radius 0.5 height 2.0 } },

68 © TMC Computer School HC20203 VRML 4 - 68 HIGHER DIPLOMA IN COMPUTING Scaling about a Center Point # Branches Transform { translation 0.0 3.0 0.0 children Shape { appearance USE White geometry Cone { bottomRadius 2.0 height 4.0 } ] } ] }

69 © TMC Computer School HC20203 VRML 4 - 69 HIGHER DIPLOMA IN COMPUTING Using a Scale Orientation #VRML V2.0 utf8 Group { children [ # Ground Shape { appearance DEF White Appearance { material Material { } } geometry Box { size 12.0 0.1 12.0 } },

70 © TMC Computer School HC20203 VRML 4 - 70 HIGHER DIPLOMA IN COMPUTING Using a Scale Orientation # Tree Transform { translation 0.0 1.0 0.0 scale 1.0 2.0 1.0 scaleOrientation 0.0 0.0 1.0 -0.785 center 0.0 -1.0 0.0 children [ # Trunk Shape { appearance USE White geometry Cylinder { radius 0.5 height 2.0 } },

71 © TMC Computer School HC20203 VRML 4 - 71 HIGHER DIPLOMA IN COMPUTING Using a Scale Orientation # Branches Transform { translation 0.0 3.0 0.0 children Shape { appearance USE White geometry Cone { bottomRadius 2.0 height 4.0 } ] } ] }


Download ppt "© TMC Computer School HC20203 VRML 4 - 1 HIGHER DIPLOMA IN COMPUTING Chapter 4 – Object Manipulation in VRML."

Similar presentations


Ads by Google