A quick and crude intro to VRML

Using a modeling tool:


Blank EZ3D screen


Add Primitive


The cylinder as it is placed into my world








modifying the cylinder: I used the mouse to select and drag the cylinder into the shape I wanted



Adding the oak.gif bitmap as a texture:
The trunk of the tree will have a bitmap applied as a texture map.



Adding a sphere…
Note that the sphere is also placed by default at (0,0,0)

I want to make the tree green and slightly transparent.

Material editing options..


This is how my tree looks in the editor


Writing VRML2.0 by hand


Source code written in VRML 2.0
#VRML V2.0 utf8

# a virtual Tree
# modified from the Lemay VRML book
# by Andy Harris

#The trunk
Shape {
appearance Appearance {
material Material {emissiveColor .41 .40 .1}
texture ImageTexture { url "oak.gif" }
}
geometry Cylinder{
radius .1
height 1
}
}

#The leaves
Transform {
translation 0 .9 0
children[
Shape {
appearance Appearance {
material Material {
emissiveColor 0 1 0
ambientIntensity 8
specularColor 0 1 0
transparency .1
}
}
geometry Sphere{
radius .5
}
}
]
}

#The brick box
Transform {
translation 0 -.5 0
children [
Shape {
appearance Appearance {
material Material {emissiveColor 1 0 0}
texture ImageTexture { url "brick.gif" }
}
geometry Box {
size 1 0.25 1
}
}
]
}


The tree in my VRML browser…