Menggambar pendopo / gazebo menggunakan VRML dengan translasi dan rotasi

7:48 AM |

Malam belum juga memejamkan mata, melihat keluar jendela terdapat bintang - bintang yang bersinar di malam hari, tiba - tiba terpikir untuk membuat obyek 3d pendopo yang memanfaatkan translasi dan rotasi, dan memanfaat kan obyek2 obyek dasar berupa silinder box shpare dll. dan berikut koding nya:

#VRML V2.0 utf8

Shape {
    appearance Appearance {
       material Material {
#diffuseColor 0.7 0.5 0.0 # Coklat
         
}
texture    ImageTexture{url "genting.jpg"}
    }
    geometry IndexedFaceSet {
       coord Coordinate {
       point [# Vertex list
              0 3 0, # vertex 0
             -5 0 5, # vertex 1
              5 0 5, # vertex 2
              5 0 -5, # vertex 3
             -5 0 -5, # vertex 4
           ]
       }
       coordIndex [# list of Faces
                  4, 3, 2, -1,
                  0, 1, 2, -1,
                  0, 2, 3, -1,
                  0, 3, 4, -1,
                  0, 4, 1, -1
                ]
    }
}

#Lampu
Transform {
   translation    0 -0.2 0
   children    [

Shape {
    appearance Appearance {
        material    Material {diffuseColor 1 1 0}
    }
    geometry Sphere    {
    radius 0.3
    }
}
]
}
#Sinar Lampu
PointLight {
   on TRUE
   color 1 1 1
   intensity 2
   location    0 -0.2 0
}

Shape {
   
    appearance Appearance {
        material    Material {}
        texture    ImageTexture {url "unduhan.jpg"}
    }
    geometry Box {
        size 10 0 10
    }
}
#kanan depan
Transform {
   translation    3.5 -3 3.5
   children    [

Shape {
   
    appearance Appearance {
        material    Material {
        diffuseColor 0.7 0.5 0.0
        }
    }
    geometry Cylinder {
    bottom TRUE
    top    TRUE
    height 6
    radius 0.4
    }
}
]
}
#kiri depan
Transform {
   translation    -3.5 -3 3.5
   children    [

Shape {
   
    appearance Appearance {
        material    Material {
        diffuseColor 0.7 0.5 0.0
        }
    }
    geometry Cylinder {
    bottom TRUE
    top    TRUE
    height 6
    radius 0.4
    }
}
]
}
#belakang kanan
Transform {
   translation    3.5 -3 -3.5
   children    [

Shape {
   
    appearance Appearance {
        material    Material {
        diffuseColor 0.7 0.5 0.0
        }
    }
    geometry Cylinder {
    bottom TRUE
    top    TRUE
    height 6
    radius 0.4
    }
}
]
}
#belakang kiri
Transform {
   translation    -3.5 -3 -3.5
   children    [

Shape {
   
    appearance Appearance {
        material    Material {
        diffuseColor 0.7 0.5 0.0
        }
    }
    geometry Cylinder {
    bottom TRUE
    top    TRUE
    height 6
    radius 0.4
    }
}
]
}
#alas 1
Transform {
   translation    0 -5.0 0
   children    [

Shape {
   
    appearance Appearance {
        material    Material {}
        texture    ImageTexture {url "images.jpg"}
    }
    geometry Box {
        size 8 0.7 8
    }
}
]
}
#alas2
Transform {
   translation    0 -5.7 0
   children    [

Shape {
   
    appearance Appearance {
        material    Material {}
        texture    ImageTexture {url "images.jpg"}
    }
    geometry Box {
        size 9 0.7 9
    }
}
]
}

#pagar belakang
Transform {
   translation    0 -2.0 -3.5
   children    [

Shape {
   
    appearance Appearance {
        material    Material {diffuseColor 0.7 0.5 0.0}
       
    }
    geometry Box {
        size 7 0.1 0.1
    }
}
]
}
Transform {
   translation    0 -3.0 -3.5
  rotation 0 0 -6 -6
   children    [

Shape {
   
    appearance Appearance {
        material    Material {diffuseColor 0.7 0.5 0.0}
       
    }
    geometry Box {
        size 7 0.1 0.1
    }
}
]
}
Transform {
   translation    0 -3.0 -3.5
  rotation 0 0 -16 -16
   children    [

Shape {
   
    appearance Appearance {
        material    Material {diffuseColor 0.7 0.5 0.0}
       
    }
    geometry Box {
        size 7 0.1 0.1
    }
}
]
}

#pagar kanan
Transform {
   translation    3.5 -2.0 0
   children    [

Shape {
   
    appearance Appearance {
        material    Material {diffuseColor 0.7 0.5 0.0}
       
    }
    geometry Box {
        size 0.1 0.1 7
    }
}
]
}
Transform {
   translation    3.5 -3.0 0
  rotation 16 0 0 16
   children    [

Shape {
   
    appearance Appearance {
        material    Material {diffuseColor 0.7 0.5 0.0}
       
    }
    geometry Box {
        size 0.1 0.1 7
    }
}
]
}
Transform {
   translation    3.5 -3.0 0
  rotation 6 0 0 6
   children    [

Shape {
   
    appearance Appearance {
        material    Material {diffuseColor 0.7 0.5 0.0}
       
    }
    geometry Box {
        size 0.1 0.1 7
    }
}
]
}
#pagar kiri
Transform {
   translation    -3.5 -2.0 0
   children    [

Shape {
   
    appearance Appearance {
        material    Material {diffuseColor 0.7 0.5 0.0}
       
    }
    geometry Box {
        size 0.1 0.1 7
    }
}
]
}
Transform {
   translation    -3.5 -3.0 0
  rotation 16 0 0 16
   children    [

Shape {
   
    appearance Appearance {
        material    Material {diffuseColor 0.7 0.5 0.0}
       
    }
    geometry Box {
        size 0.1 0.1 7
    }
}
]
}
Transform {
   translation    -3.5 -3.0 0
  rotation 6 0 0 6
   children    [

Shape {
   
    appearance Appearance {
        material    Material {diffuseColor 0.7 0.5 0.0}
       
    }
    geometry Box {
        size 0.1 0.1 7
    }
}
]
}



dan berikut tampilannya






0 comments:

Post a Comment