Grundlagen 2
|
Grundeinstellungen |
Blickpunkt und Blickrichtung |
Viewpoint { position -4 1.5 3 orientation 0.5 0.9 0.2 -0.9 fieldOfView 0.7854 description "Blick1" } |
Beleuchtung Defaultmäßig ist das headlight eingestellt, Parallelbeleuchtung und Zentralbeleuchtung stehen zur Verfügung müssen aber explizit eingesetzt werden. VRML stellt Eigenschatten dar, nicht aber Schlagschatten. |
NavigationInfo { headlight TRUE } DirectionalLight { on TRUE intensity 1 color 1 1 0 direction 0 -1 0 } SpotLight { direction 1 -1 -1 location -5 5 5 radius 30 beamWidth 1.57 cutOffAngle 1.57 } PointLight { radius 10 location 0 1 0 } |
Grundkörper |
|
#VRML V2.0 utf8 Background { skyColor 0.5 0.5 1.0 } Shape { appearance Appearance { material Material {} } geometry Cone { bottomRadius 2.0 height 8.0 side TRUE bottom TRUE } } Shape { appearance Appearance { material Material { diffuseColor 1.0 0.5 0} } geometry Cylinder { radius 1 height 6.0 bottom TRUE side TRUE } top TRUE } Shape { appearance Appearance { material Material { emissiveColor 0.0 0.0 1.0} } geometry Sphere { radius 2} } Shape { appearance Appearance { material Material { diffuseColor 1.0 0.0 0.0} } geometry Box { size 5 0.1 5} } |
Shape { geometry Box {} appearance Appearance { material Material { diffuseColor 0 0.6 0.8 specularColor 0 0.3 0.5 emissiveColor 0 0.1 0.2 ambientIntensity 0 transparency 0.5 } } } |
DEF - Switch
|
DEF Hugo Shape { appearance Appearance { material Material {} } geometry Sphere {radius 2} } Switch { choice [ DEF Hugo Shape { appearance Appearance { material Material {} } geometry Sphere {radius 2} } DEF Anton Shape { appearance Appearance { material Material {} } geometry Box { size 1 4 1} } DEF Franz Shape { appearance Appearance { material Material {} } geometry Cylinder {radius 2 height 0.5} } ] } USE [Hugo] |
Inline damit können (fertige) VRML-Objekte eingefügt werden. Sie belasten dann nicht das Skript (1.wrl ist irgendein schon programmiertes und gespeichertes Objekt) |
#VRML V2.0 utf8 Inline { url "1.wrl" bboxSize 10 10 10 } Transform { translation 3 0 0 children [ Inline { url "2.wrl" bboxSize 10 10 10 } ] } |
Gruppe hier wird eine Gruppe aus zwei Körpern gebildet. |
Group { children [ Shape { geometry Cylinder { height 5 radius 0.5 } } Shape { geometry Sphere {} ] } |