Transcript VRML Shapes

VRML Shapes
Box
•
•
•
•
•
Box {
field SFVec3f size 2 2 2
}
Centered at (0, 0, 0)
Outside only
Sphere
• Sphere {
• field SFFloat radius 1
• }
Cone
• Cone {
• field
• field
• field
• field
• }
SFFloat
SFFloat
SFBool
SFBool
bottomRadius 1
height
2
side
TRUE
bottom
TRUE
• Side and bottom refer to existence of
these parts of the geometry
• Defined for Outside only
Cylinder
• Cylinder {
• field SFBool
• field SFFloat
• field SFFloat
• field SFBool
• field SFBool
• }
• Outside only
bottom TRUE
height 2
radius 1
side TRUE
top TRUE
VRML Shapes
ElevationGrid
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
ElevationGrid {
eventIn MFFloat set_height
exposedField SFNode color
NULL
exposedField SFNode normal
NULL
exposedField SFNode texCoord
NULL
field
MFFloat height
[] # (-,)
field
SFBool ccw
TRUE
field
SFBool colorPerVertex TRUE
field
SFFloat creaseAngle
0
# [0,]
field
SFBool normalPerVertex TRUE
field
SFBool solid
TRUE
field
SFInt32 xDimension
0
# [0,)
field
SFFloat xSpacing
1.0 # (0,)
field
SFInt32 zDimension
0
# [0,)
field
SFFloat zSpacing
1.0 # (0,)
}
•
•
•
•
•
•
•
•
•
•
•
IndexedFaceSet
IndexedFaceSet {
field
eventIn
MFInt32 set_colorIndex
field
eventIn
MFInt32 set_coordIndex
field
eventIn
MFInt32 set_normalIndex
field
field
eventIn
MFInt32 set_texCoordIndex
field
exposedField SFNode color
NULL
field
exposedField SFNode coord
NULL
field
exposedField SFNode normal
NULL field
exposedField SFNode texCoord
NULL }
field
SFBool ccw
TRUE
MFInt32 colorIndex
SFBool colorPerVertex
SFBool convex
MFInt32 coordIndex
[]
SFFloat creaseAngle
0
MFInt32 normalIndex
[]
SFBool normalPerVertex TRUE
SFBool solid
TRUE
MFInt32 texCoordIndex []
Indexed Face Set Example
•
#VRML V2.0 utf8
•
•
•
•
•
•
•
•
•
•
Shape {
geometry IndexedFaceSet {
coordIndex [ 0, 1, 3, -1, 0, 2, 3, -1 ]
coord Coordinate {
point [ 0 0 0, 1 0 0, 1 0 -1, 0.5 1 0 ]
}
color Color {
color [ 0.2 0.7 0.8, 0.5 0 0, 0.1 0.8 0.1, 0 0 0.7 ]
}
normal Normal {
vector [ 0 0 1, 0 0 1, 0 0 1, 0 0 1 ]
}
texCoord TextureCoordinate {
point [ 0 0, 1 0, 1 0.4, 1 1 ]
}
}
appearance Appearance {
material Material { transparency 0.5 }
texture PixelTexture {
image 2 2 1 0xFF 0x80 0x80 0xFF
}
}
}