Obyek VRML menggunakan Node Transformasi

7:27 PM |

  Salam jumpa kembali, semalam penulis bertemu dengan saudara - saudaraku, rencana nya sih penulis mau melanjutkan menulis tentang dasar - dasar VRML tapi....., saudaraku yang bernama Vidi memberiku sebuah kertas yang ternyata adalah ttugas UTS nya tentang VRML,. dari kertas hasil foto copy yang kurang jelas tersebut terlihat beberpa obyek 3D VRML yang ditata sedemkian rupa,, wah jadi ingin mencoba, Oke lah kalo Begitu  Setelah Semalam Mencoba sepulang dari ngopy bersama Irfan dan Sutris Akhirnya berhasil membuat yang seperti ini :





Dan ini kode untuk Obyek Seperti diatas :

#VRML V2.0 utf8
Background {
    skyColor    [
    1 0 1
    0 1 0
    1 0 1
    ]
    skyAngle [1.57 3.14]
}

Transform {
    translation    0 -2 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 0.5 0.5 1}
    }
    geometry Box {
     size 8 0.5 4
    }
}
]
}

Transform {
    translation    0 0 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 0 0.5 1}
    }
    geometry Cylinder {
    bottom TRUE
    top    TRUE
    height 2.5
    radius 0.3
    }
}
]
}

Transform {
    translation    0 2.3 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 0}
    }
    geometry Sphere {
    radius 0.7
    }
}
]
}
 # Kerucut 1
Transform {
       translation    2.5 -0.8 1.5
   children    [
       Shape    {
           appearance Appearance {
               material Material    {diffuseColor 1 1 0}
           }
           geometry    Cone {
           bottomRadius    0.3
           height 2.5
           }
       }
   ]
}
# Kerucut 2
Transform {
       translation    2.5 -0.8 -1.5
   children    [
       Shape    {
           appearance Appearance {
               material Material    {diffuseColor 1 1 0}
           }
           geometry    Cone {
           bottomRadius    0.3
           height 2.5
           }
       }
   ]
}
# Kerucut 3
Transform {
       translation    -2.5 -0.8 1.5
   children    [
       Shape    {
           appearance Appearance {
               material Material    {diffuseColor 1 1 0}
           }
           geometry    Cone {
           bottomRadius    0.3
           height 2.5
           }
       }
   ]
}
# Kerucut 4
Transform {
       translation    -2.5 -0.8 -1.5
   children    [
       Shape    {
           appearance Appearance {
               material Material    {diffuseColor 1 1 0}
           }
           geometry    Cone {
           bottomRadius    0.3
           height 2.5
           }
       }
   ]
}
#Bola Kanan 1
Transform {
    translation    5 3 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}
#Bola Kanan 2
Transform {
    translation    5 1 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}
#Bola Kanan 3
Transform {
    translation    5 -1 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}
#Bola Kanan 4
Transform {
    translation    5 -3 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}
#Bola Kanan 5
Transform {
    translation    5 -5 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}
#Bola Kanan 6
Transform {
    translation    5 -7 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}
#Bola Kanan 7
Transform {
    translation    7 -2 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}
#Bola Kanan 8
Transform {
    translation    9 -2 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}
#Bola Kanan 9
Transform {
    translation    11 -2 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}

#Bola Kiri 1
Transform {
    translation    -5 3 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}
#Bola Kiri 2
Transform {
    translation    -5 1 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}
#Bola Kiri 3
Transform {
    translation    -5 -1 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}
#Bola Kiri 4
Transform {
    translation    -5 -3 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}
#Bola Kiri 5
Transform {
    translation    -5 -5 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}
#Bola Kiri 6
Transform {
    translation    -5 -7 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}
#Bola Kiri 7
Transform {
    translation    -7 -2 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}
#Bola Kiri 8
Transform {
    translation    -9 -2 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}
#Bola Kiri 9
Transform {
    translation    -11 -2 0
    children [
Shape {
    appearance Appearance {
        material    Material { diffuseColor 1 0 1}
    }
    geometry Sphere {
    radius 0.5
    }
}
]
}





Sekian dulu dan terimakasih

0 comments:

Post a Comment