Grundlagen 3
|
Punktfelder, Polyeder |
|
Shape { appearance Appearance { material Material { emissiveColor 1 1 1 } } geometry PointSet { coord Coordinate { point [ -2 0 2, -2 0 -2, 2 0 -2, 2 0 2, 0 2 0, ] } } } |
Shape { appearance Appearance { material Material {} } geometry IndexedLineSet { coord Coordinate { point [ 2, 0, 2, -2, 0, 2, -2, 0,-2, 2, 0,-2, 0, 3, 0 ] } coordIndex [ 0,1,2,3,0,-1, 0,4,-1, 0,4,-1, 1,4,-1, 2,4,-1, 3,4,-1, ] } } |
DEF Punkte Coordinate { point [ 2, 0, 2, -2, 0, 2, -2, 0,-2, 2, 0,-2, 0, 3, 0 ] } Shape { appearance Appearance { material Material {} } geometry IndexedLineSet { coord USE Punkte coordIndex [ 0,1,2,3,0,-1, 0,4,-1, 1,4,-1, 2,4,-1, 3,4,-1, ] } } |
Shape { appearance Appearance { material Material {} } geometry IndexedFaceSet { coord Coordinate { point [ 2, 0, 2, -2, 0, 2, -2, 0,-2, 2, 0,-2, 0, 3, 0 ] } coordIndex [ 0,1,2,3,0,-1, 0,1,4,0,-1, 1,2,4,1,-1, 2,3,4,2,-1, 3,0,4,3,-1, ] } } |
Schraublinie
#VRML V2.0 utf8 Background { skyColor 0.5 0.5 1.0 } DEF SchrbLinie Coordinate { point [ 1.000 0.0 0.000 0.966 0.2 0.259 0.866 0.4 0.500 0.707 0.6 0.707 0.500 0.8 0.866 0.259 1.0 0.966 0.000 1.2 1.000 -0.259 1.4 0.966 -0.500 1.6 0.866 -0.707 1.8 0.707 -0.866 2.0 0.500 -0.966 2.2 0.259 -1.000 2.4 0.000 -0.966 2.6 -0.259 -0.866 2.8 -0.500 -0.707 3.0 -0.707 -0.500 3.2 -0.866 -0.259 3.4 -0.966 0.000 3.6 -1.000 0.259 3.8 -0.966 0.500 4.0 -0.866 0.707 4.2 -0.707 0.866 4.4 -0.500 0.966 4.6 -0.259 1.000 4.8 0.000 ] } Shape { appearance Appearance { material Material {} } geometry IndexedLineSet { coord USE SchrbLinie coordIndex [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 -1 ] } } |
Farbgebung
|
#VRML V2.0 utf8 Shape { geometry IndexedLineSet { coord Coordinate { point [ -1 1 0, # PunktIndex 0 -1 -1 0, # PunktIndex 1 1 -1 0, # PunktIndex 2 1 1 0 # PunktIndex 3 0 0 2 ] } coordIndex [ 0 1 2 3 0 -1 0 4 -1 1 4 -1 2 4 -1 3 4 -1 ] colorPerVertex FALSE color Color { color [ 1.0 0.0 0.0, # FarbIndex 0, rot 0.0 1.0 0.0 # FarbIndex 1, grün 0.0 0.0 1.0 # FarbIndex 2, blau ] } colorIndex [ 0, 1, 2, 1, 2 ] # Liniengruppe0-Farbe0, Linie1-Farbe1, Linie2-Farbe2, Linie3-Farbe1 .. } } #VRML V2.0 utf8 Shape { appearance Appearance { material Material {} } geometry IndexedFaceSet { solid FALSE coord Coordinate { point [ 2, 0, 2, -2, 0, 2, -2, 0,-2, 2, 0,-2, 0, 3, 0 ] } coordIndex [ 0,1,2,3,0,-1, 0,1,4,0,-1, 1,2,4,1,-1, 2,3,4,2,-1, 3,0,4,3,-1, ] colorPerVertex FALSE color Color { color [ 1 0 0 0 1 0 0 0 1 ] } colorIndex [ 2 1 0 1 0 ] } } |
Geometrische Transformationen |
|
#VRML V2.0 utf8 NavigationInfo {type "EXAMINE" headlight TRUE} Transform { translation -2 0 0 rotation 1 0 0 3.1416 children [ DEF Kegel Shape { appearance Appearance { material Material { diffuseColor 1 0 1 shininess 1 transparency 0.1 } } geometry Cone { bottomRadius 1 height 2 side TRUE bottom TRUE } } ] } Transform { translation 2 0 0 children [ USE Kegel ]} |
Hier wird ein mit DEF eingeführter und daher sichtbarer Quader um zwei verschiedene Achsen um 45° gedreht, die Achsen werden dann noch durch kleine Zylinder angedeutet. |
#VRML V2.0 utf8 DEF Dingsbums Shape { appearance Appearance { material Material { } } geometry Box {size 0.5 3 0.5 } } Switch { choice [DEF Achse Shape { appearance Appearance { material Material { diffuseColor 1.0 0.5 0} } geometry Cylinder { radius 0.1 height 5 } } ] } Transform { children [ USE Dingsbums ] center 2 0 0 rotation 0 1 0 0.78 } Transform { children [ USE Dingsbums ] center -4 0 0 rotation 0 1 0 0.78 } Transform { children [ USE Achse ] translation 2 0 0 } Transform { children [ USE Achse ] translation -4 0 0 } |
Ein schönes Beispiel ist auch das Stabmodell eines einschaligen
Drehhyperboloides,
ausgehend von zwei Erzeugenden, je eine aus jeder Schar.#VRML V2.0 utf8 DEF Erzeug Group { children [ Transform { children Shape { appearance Appearance { material Material { diffuseColor 1 0 0 } } geometry Cylinder { radius 0.04 height 6 } } translation 0 0 1 rotation 0 0 1 0.6 } Transform { children Shape { appearance Appearance { material Material { diffuseColor 0 0 1 } } geometry Cylinder { radius 0.04 height 6 } } translation 0 0 1 rotation 0 0 1 -0.6 } ] } Transform { children [ USE Erzeug ] rotation 0 1 0 0.262 } Transform { children [ USE Erzeug ] rotation 0 1 0 0.524 } Transform { children [ USE Erzeug ] rotation 0 1 0 0.785 } Transform { children [ USE Erzeug ] rotation 0 1 0 1.047 } Transform { children [ USE Erzeug ] rotation 0 1 0 1.309 } Transform { children [ USE Erzeug ] rotation 0 1 0 1.571 } Transform { children [ USE Erzeug ] rotation 0 1 0 1.833 } Transform { children [ USE Erzeug ] rotation 0 1 0 2.094 } Transform { children [ USE Erzeug ] rotation 0 1 0 2.356 } Transform { children [ USE Erzeug ] rotation 0 1 0 2.618 } Transform { children [ USE Erzeug ] rotation 0 1 0 2.880 } Transform { children [ USE Erzeug ] rotation 0 1 0 3.142 } Transform { children [ USE Erzeug ] rotation 0 1 0 3.403 } Transform { children [ USE Erzeug ] rotation 0 1 0 3.665 } Transform { children [ USE Erzeug ] rotation 0 1 0 3.927 } Transform { children [ USE Erzeug ] rotation 0 1 0 4.189 } Transform { children [ USE Erzeug ] rotation 0 1 0 4.451 } Transform { children [ USE Erzeug ] rotation 0 1 0 4.712 } Transform { children [ USE Erzeug ] rotation 0 1 0 4.974 } Transform { children [ USE Erzeug ] rotation 0 1 0 5.236 } Transform { children [ USE Erzeug ] rotation 0 1 0 5.498 } Transform { children [ USE Erzeug ] rotation 0 1 0 5.760 } Transform { children [ USE Erzeug ] rotation 0 1 0 6.021 } Transform { children [ USE Erzeug ] rotation 0 1 0 6.283 } |