Académique Documents
Professionnel Documents
Culture Documents
Practical
VRML V 1.0 & V 2.0
For Beginner
UNIVERSITAS NASIONAL TEKNIK INFORMATIKA
HIMPUNAN MAHASISWA TEKNIK INFORMATIKA
1.STRING
Software => cortona3D viewer ,VRMLpad
#VRML V1.0 ascii
Separator {
FontStyle{
style ITALIC
size 11
AsciiText{
string [ "selamat datang", "di", "Dunia anak"]
justification CENTER
}
}
2.CUBE
Material
{ diffuseColor [ 1 0 0 ]
specularColor[ 0. 5 0. 5 0. 5] }
Transform { translation 3 0 0 }
Sphere { }
Material
{ diffuseColor [ 1 0 0 ]
specularColor[ 0. 9 0. 9 0. 9] }
Transform { translation 3 0 0 }
Sphere { }
7.TRANSPARENCY
Material
{ diffuseColor [ 1 0 0 ]
transparency[ 0. 5 ] }
Transform { translation 3 0 0 }
Cone { }
Material
{ diffuseColor [ 1 0 0 ]
transparency[ 0. 1 ] }
Transform { translation 3 0 0 }
Cone { }
#VRML V1.0 ascii
Material
{ diffuseColor [ 1 0 1 ]
transparency[ 0. 1 ] }
Transform { translation 3 0 0 }
Cylinder { }
Material
{ diffuseColor [ 0 1 0 ]
transparency[ 0. 5 ] }
Transform { translation 3 0 0 }
Cone { }
Material
{ diffuseColor [ 0 1 1 ]
transparency[ 0. 1 ] }
Transform { translation 3 0 0 }
Cube { }
Material
{ diffuseColor [ 1 0 0 ]
transparency[ 0. 1 ] }
Transform { translation 3 0 0 }
Sphere { }
8.EMISSIVE
Material
{ diffuseColor [ 1 0 0 ]
emissiveColor[ 0 0 0 ] }
Transform { translation 3 0 0 }
Cone { }
Material
{ diffuseColor [ 1 0 0 ]
emissiveColor[ 0. 9 0. 9 0. 9] }
Transform { translation 3 0 0 }
Cone { }
9.TEXTURE
Separator {#lantai
Texture2 {
filename "kayu.jpg"
}
Coordinate3 {
point [
-5 0 -5,
-5 0 5,
5 0 5,
5 0 -5
]
}
IndexedLineSet {
coordIndex [
0, 1, 2, 3, 0, -1
]
}
}
Separator {# dinding tengah
Transform {
translation 0 2.5 -3.5
}
Texture2 {
filename "batu.jpg"
}
}
}
geometry Cone {
bottomRadius 1
height 3
}
}
#VRML V2.0 utf8
Shape {
appearance Appearance{
material Material{
diffuseColor 0.27 0 0
specularColor 0.61 0.13 0.18
shininess 0.20
ambientIntensity 0.15
}
}
geometry Cone {
bottomRadius 1
height 3
}
}
#VRML V2.0 utf8
Shape {
appearance Appearance{
material Material{
diffuseColor 0.1 0.03 0.22
specularColor 0.64 0 0.98
shininess 0.20
ambientIntensity 0.17
}
}
geometry Cone {
bottomRadius 1
height 3
}
}
#VRML V2.0 utf8
Shape {
appearance Appearance{
material Material{
diffuseColor 0.22 0.15 0
specularColor 0.71 0.7 0.56
shininess 0.16
ambientIntensity 0.4
}
}
geometry Cone {
bottomRadius 1
height 3
}
}
#VRML V2.0 utf8
Shape {
appearance Appearance{
material Material{
diffuseColor 0.3 0.3 0.5
specularColor 0.7 0.7 0.8
shininess 0.1
ambientIntensity 0.3
}
}
geometry Cone {
bottomRadius 1
height 3
}
}
#VRML V2.0 utf8
Shape {
appearance Appearance{
material Material{
diffuseColor 0.3 0.11 0
specularColor 0.75 0.33 0.00
shininess 0.08
ambientIntensity 0.26
}
}
geometry Cone {
bottomRadius 1
height 3
}
}
#VRML V2.0 utf8
Transform {
children [
NavigationInfo { headlight FALSE } # We’ll add our own light
DirectionalLight { # First child
direction 0 0 -1 # Light illuminating the scene
}
Transform { # Second child - a red sphere
translation 3 0 1
children [
Shape {
geometry Sphere { radius 2.3 }
appearance Appearance {
material Material { diffuseColor 1 0 0 } # Red
}
}
]
}
Transform { # Third child - a blue box
translation -2.4 .2 1
rotation 0 1 1 .9
children [
Shape {
geometry Box {}
appearance Appearance {
material Material { diffuseColor 0 0 1 } # Blue
}
}
]
}
] # end of children for world
}
#VRML V2.0 utf8
PROTO TwoColorStool [ field SFColor legColor .8 .4 .7
field SFColor seatColor .6 .6 .1 ]
{
Transform {
children [
Transform { # stool seat
translation 0 0.6 0
children
Shape {
appearance Appearance {
material Material { diffuseColor IS seatColor }
}
geometry Box { size 1.2 0.2 1.2 }
}
}
Transform { # first stool leg
translation -.5 0 -.5
children
DEF Leg Shape {
appearance Appearance {
material Material { diffuseColor IS legColor }
}
geometry Cylinder { height 1 radius .1 }
}
}
Transform { # another stool leg
translation .5 0 -.5
children USE Leg
}
Transform { # another stool leg
translation -.5 0 .5
children USE Leg
}
Transform { # another stool leg
translation .5 0 .5
children USE Leg
}
] # End of root Transform’s children
} # End of root Transform
} # End of prototype
}
]
}
#VRML V2.0 utf8
# right_side_up
# ice cream
Transform{
rotation 1 0 0 3.14
children Shape {
appearance Appearance {
material Material {
diffuseColor 0.5 0.5 0
} # end material
} # end appearance
geometry Cone {
bottom FALSE # make bottom invisible
} # end cone
} # end shape
} # end transform
#VRML V2.0 utf8
#DEF USE example...
Cube
{ width 1.5
height 1
depth 1.5 }
}
DEF Atap Separator
{
Texture2 {filename "batik.jpg"}
Transform {translation -1 0.5 1}
Coordinate3
{point [0 0 0,
2 0 0,
2 0 -2,
0 0 -2,
1 1 -1] }
IndexedFaceSet
{ coordIndex
[0, 1, 2, 3, 0, -1,
0, 1, 4, -1,
1, 2, 4, -1,
2, 3, 4, -1,
0, 3, 4, -1] }
}
Separator
{
Transform { translation 3 -2 -2}
#kaki meja#
DEF Kaki Separator
{
Texture2 {filename "batu.jpg"}
Cylinder
{ radius 0.5
height 5 }
}
}
}
# kaki meja ke-2#
Separator
{Transform {translation -3 -2 -2}
USE Kaki}
{ point [
1 0 1, 1 0 -1, -1 0 -1, -1 0 1,
2 -1 2, 2 -1 -2, -2 -1 -2, -2 -1 2] }
IndexedFaceSet
{ coordIndex
[0, 1, 2, 3, -1,
4, 5, 6, 7, -1,
0, 1, 5, 4, -1,
1, 2, 6, 5, -1,
2, 3, 7, 6, -1,
3, 0, 4, 7, -1] }
}
#alas penutup poligon#
DEF Alas Separator
{
Texture2 {filename "silver.jpg" }
Transform
{translation 0 1 0}
Cube {width 3.5
depth 3.5
height 0.05}
}
#tiang monas#
DEF Tiang Separator
{
Texture2 {filename "silver.jpg" }
Transform {translation 0 3 0}
Cube {width 0.75
depth 0.75
height 5 }
}
#bagian atas monas#
DEF Atap Separator
{
www.unas.ac.id