Click here to load reader
Upload
nuraini-mohd-ghani
View
600
Download
0
Embed Size (px)
DESCRIPTION
Visual Reality and VRML student..
Citation preview
PREPARED BY : NURAINI MOHD GHANI 1
PREPARED BY : NURAINI MOHD GHANI 2
Shapes are the building blocks of a VRML world
Primitive Shapes are standard building blocks:
•Box
•Cone
•Cylinder
•Sphere
•Text
Syntax: Shape
A Shape node builds a shape
appearance - color and texture
geometry - form, or structure
shape {
appearance . . .
geometry . . .
}
PREPARED BY : NURAINI MOHD GHANI 3
Specifying appearance
Shape appearance is described by appearance nodes
For now, we'll use nodes to create a shaded white
appearance:
Shape {
appearance Appearance {
material Material { }
}
geometry . . .
}
PREPARED BY : NURAINI MOHD GHANI 4
Specifying geometry:
Shape geometry is built with geometry nodes:
Box { . . . }
Cone { . . . }
Cylinder { . . . }
Sphere { . . . }
Text { . . . }
• Geometry node fields control dimensions
• Dimensions usually in meters, but can be anything
PREPARED BY : NURAINI MOHD GHANI 5
Syntax: Box
A Box geometry node builds a box
size - width, height, depth
Shape {
appearance Appearance {
material Material { }
}
geometry Box {
size 2.0 2.0 2.0
}
}
PREPARED BY : NURAINI MOHD GHANI 6
Syntax: Cone
• A Cone geometry node builds an upright cone
• height and bottomRadius - cylinder size
• bottom and side - parts on or off
Shape {
appearance Appearance {
material Material { }
}
geometry Cone {
height 2.0
bottomRadius 1.0
bottom TRUE
side TRUE
}
}
PREPARED BY : NURAINI MOHD GHANI 7
Syntax: Cylinder
• A Cylinder geometry node builds an upright cylinder
• height and radius - cylinder size
• bottom, top, and side - parts on or off
Shape {
appearance Appearance {
material Material { }
}
geometry Cylinder {
height 2.0
radius 1.0
bottom TRUE
top TRUE
side TRUE
}
}PREPARED BY : NURAINI MOHD GHANI 8
Syntax: Sphere
• A Sphere geometry node builds a sphere
• radius - sphere radius
Shape {
appearance Appearance {
material Material { }
}
geometry Sphere {
radius 1.0
}
}
PREPARED BY : NURAINI MOHD GHANI 9
Syntax: Text• A Text geometry node builds text
• string - text to build • fontStyle - font control
Shape {
appearance Appearance {
material Material { }
}
geometry Text {
string [ "Text","Shape" ]
fontStyle FontStyle {
style "BOLD"
}
}
}
PREPARED BY : NURAINI MOHD GHANI 10
#VRML V2.0 utf8# A cylinder
Shape {
appearance Appearance {
material Material { }}
geometry Cylinder {
height 2.0
radius 1.5}
}
PREPARED BY : NURAINI MOHD GHANI 11
• Shapes are built centered in the world
• A VRML file can contain multiple
shapes
• Shapes overlap when built at the
same location
PREPARED BY : NURAINI MOHD GHANI 12
Shapes are built using a Shape node
Shape geometry is built using geometry
nodes, such as Box, Cone, Cylinder,
Sphere, and Text
·Text fonts are controlled using a
FontStyle node
PREPARED BY : NURAINI MOHD GHANI 13