VRML 97 Geometry
Transkript
VRML 97 Geometry
Computer Graphics Group Geometry: 10 nodes VRML 97 • Children of Shape nodes (field: geometry) • Boundary representation only Department of Computer Science and Engineering http://www.cgg.cvut.cz Building Static Worlds • Geometry • Grouping & Transformations • Colors Box Cone Cylinder +/-cap +/-caps Sphere • Undetermined number of facets • Back faces never generated Jiří Žára VRML 97 - Static worlds 1 Geometry (contd.) Jiří Žára VRML 97 - Static worlds 2 The most sophisticated node IndexedFaceSet coord IndexedFaceSet IndexedLineSet PointSet Coordinate point Normal vector Color color TextureCoordinate point normal color texCoord Extrusion ElevationGrid Text coordIndex, normalIndex, colorIndex, texCoordIndex Jiří Žára VRML 97 - Static worlds 3 Jiří Žára IndexedFaceSet - other params. colorPerVertex normalPerVertex convex ccw solid creaseAngle TRUE TRUE TRUE TRUE TRUE 0 VRML 97 - Static worlds 4 Extrusion … 2,5D crossSection [1 -1 1, 1 -1, -1 -1, 1, 1 1] # profile, stencil, contour spine [0 0 0, 0 1 0] # trajectory scale orientation [1 1] # for each section [0 0 1 0] # dtto beginCap, endCap, convex, ccw, solid, creaseAngle Jiří Žára VRML 97 - Static worlds 5 Jiří Žára VRML 97 - Static worlds 6 1 Extrusion - example ElevationGrid 0 0 1.0 1.0 [] xDimension zDimension xSpacing zSpacing height # number of columns # number of rows # array of heights color, normal, texCoord ... SFNode colorPerVertex, normalPerVertex, ccw, solid, creaseAngle crossSection: 8 points, spine: 8 points Jiří Žára VRML 97 - Static worlds 7 Jiří Žára VRML 97 - Static worlds Making scene graph - group nodes 8 Group Group container for nodes children [] Transform dtto + transformation Shape container for one object bboxSize bboxCenter -1 -1 –1 # hint to browser 0 0 0 # hint to browser (geometry + appearance) Inline Jiří Žára container for external file VRML 97 - Static worlds 9 Jiří Žára VRML 97 - Static worlds Transform scale scaleOrientation rotation center translation 10 Shape # 1st transf. Group, Transform # rotation before scaling # rotation (2nd transf.) children Shape # pivot point for rotation ... # 3rd transf. appearance Appearance geometry Box, Cone, ... For different order of transformations use graph hierarchy. Jiří Žára VRML 97 - Static worlds 11 Jiří Žára VRML 97 - Static worlds 12 2 Inline Colors url [] # list of URLs bboxSize bboxCenter -1 -1 –1 # hint to browser 0 0 0 # hint to browser • One color for the whole object Material { } A child of Appearance node. • Individual colors per faces/vertices First successful URL will be used Color { } For IndexedFaceSet, IndexedLineSet, PointSet, and ElevationGrid. Jiří Žára VRML 97 - Static worlds 13 Jiří Žára Material: Phong shading coeffs. ambientIntensity diffuseColor specularColor shininess emissiveColor transparency VRML 97 - Static worlds 14 End of this part 0.2 0.8 0.8 0.8 0 0 0 0.2 0 0 0 0 • Set as many as possible parameters to zeros • Utilize DEF & USE statements Jiří Žára VRML 97 - Static worlds 15 Jiří Žára VRML 97 - Static worlds 16 3