Komputer Grafik
-
Upload
masithapangulu -
Category
Documents
-
view
137 -
download
11
description
Transcript of Komputer Grafik
LAPORAN PRAKTIKUM KOMPUTER GRAFIK
PENGENALAN X3D
OLEH
NAMA : MASITHA PANGULU
NIM : 12/330312/TK/39488
JURUSAN TEKNIK GEODESI DAN GEOMATIKA
FAKULTAS TEKNIK
UNIVERSITAS GADJAH MADA
2013
I. Tujuan :
Mahasiswa dapat mengetahui dasar-dasar pemrograman XML
Mahasiswa dapat menggunakan X3D editor
II. Dasar Teori :
X3D adalah sebuah program dengan basis bahasa pemrograman VRML (Virtual
Reality Markup Language).X3D merupakan sebuah program yang dibuat untuk membuat
dan menampilkan objek-objek 3D. X3D mempunyai fitur-fitur khusus untuk bidang CAD,
Animasi Humanoid, dan juga Geospasial. Dalam pengoperasiannya X3D melibatkan
sistem matematika yaitu sistem koordinat dan transformasi.
III. Langkah kerja :
Untuk dapat menampilkan objek – objek 3D dapat dengan menggunakan program
X3D. Langkah-langkah yang dilakukan secara berurutan dijelaskan sebagai berikut :
1. Install pogram X3D sesuai dengan spesifikasi yang ada di komputer / laptop anda
2. Menjalankan program X3D yang sudah diinstal
3. Menuliskan lembar kerja pada new X3D scene
4. Menyimpan file dengan format X3D
5. Untuk melihat hasil tampilan objek 3D yang telah dibuat bisa menggunakan octaga
player
IV. Hasil Praktikum
Sphere
Script : Hasil :
<Scene>
<Shape>
<Sphere radius='1.5'/>
<Appearance>
<Material/>
</Appearance>
</Shape>
</Scene>
Box
Script : Hasil :
<Scene>
<Shape>
<Box size='3 3 3'/>
<Appearance>
<Material/>
</Shape>
</Scene>
Cone
Script : Hasil :
<Scene>
<Shape>
<Cone bottomRadius='1.5' height='1.5'/>
<Appearance>
<Material/>
</Appearance>
</Shape>
</Scene>
Cylinder
Script : Hasil :
<Scene>
<Shape>
<Cylinder height='1.5' radius='1'/>
<Appearance>
<Material/>
</Appearance>
</Shape>
</Scene>
Adding Color
Script : Hasil :
<Scene>
<Shape>
<Cone bottomRadius='1' height='2.4'/>
<Appearance>
<Material diffuseColor="0 3 0"/>
</Appearance>
</Shape>
<Shape>
<Sphere radius='1'/>
<Appearance>
<Material diffuseColor="3 5 0"/>
</Appearance>
</Shape>
<Shape>
<Box size='1.5 1.5 1.5'/>
<Appearance>
<Material diffuseColor="0 0 1"/>
</Appearance>
</Shape>
</Scene>
Adding Image
Script : Hasil :
<Scene>
<Shape>
<Box/>
<Appearance>
<Material/>
<ImageTexture url="image1.jpg"/>
</Appearance>
</Shape>
<Shape>
<Cone bottomRadius='1' height='3'/>
<Appearance>
<Material/>
<ImageTexture url="image2.jpg"/>
</Appearance>
</Shape>
</Scene>
Rotate
Script : Hasil :
<Scene>
<Shape>
<Box size='1 2 3'/>
<Appearance>
<Material diffuseColor="2 3 5"/>
</Appearance>
</Shape>
<Transform translation="3 0 0" rotation="1 0 0
1.57" >
<Shape>
<Box size='3 2 1'/>
<Appearance>
<Material diffuseColor="1 0 0"/>
</Appearance>
</Shape>
</Transform>
</Scene>
Translate
Script :
<Scene>
<Shape>
<Box size='1 1.5 2'/><!--Add a single geometry node here-->
<Appearance>
<Material diffuseColor="1 5 0"/>
</Appearance>
</Shape>
<Transform translation="3 3 0">
<Shape>
<Box size='1 1.5 2'/><!--Add a single geometry node here-->
<Appearance>
<Material diffuseColor="1 0 5"/>
</Appearance>
</Shape>
</Transform>
</Scene>
Hasil :
Ekstrusion
Script :
<Scene>
<Shape>
<Extrusion crossSection='4 4, 0 4, 0 0, 4 0, 4 4' spine='0 0 0, 0 0.5 0, 0 1 0, 0 1.5
0, 0 2 0' scale='1 1, 1 1, 0.5 0.5, 1 1, 1 1'/>
<Appearance>
<Material diffuseColor="0 3 7"/>
</Appearance>
</Shape>
</Scene>
Hasil :
Indexed face set
Script :
<Scene>
<Shape>
<IndexedFaceSet coordIndex="0 1 2 3 -1
1 5 6 2 -1
2 6 7 3 -1
7 4 0 3 -1
0 4 5 1 -1
4 8 5 -1
5 8 9 6 -1
6 9 7 -1
7 9 8 4 -1
">
<Coordinate point=" 0 0 0,
4 0 0,
4 0 6,
0 0 6,
0 5 0,
4 5 0,
4 5 6,
0 5 6,
2 6 1,
2 6 5
">
</Coordinate>
</IndexedFaceSet>
<Appearance>
<Material diffuseColor="1 1 0"/>
</Appearance>
</Shape>
</Scene>
Hasil :
Elvation grid
Script :
<Scene>
<Shape>
<ElevationGrid xDimension="7" xSpacing="2"
zDimension="7" zSpacing="2"
height="1 3 1 2 0 1 2
0 1 2 1 0 2 1
1 3 1 2 0 1 2
0 1 2 1 0 2 1
1 3 1 2 0 1 2
0 1 2 1 0 2 1
1 3 1 2 0 1 2 ">
</ElevationGrid>
<Appearance>
<Material diffuseColor="0 1 3"/>
</Appearance>
</Shape>
</Scene>
Hasil :
Bangunan Teknik Kimia
Script :
<Scene>
<!-- bangunan -->
<Shape>
<IndexedFaceSet coordIndex="
0 6 5 2 1 -1
2 5 4 3 -1
0 1 8 7 -1
1 2 9 8 -1
2 3 10 9 -1
3 4 11 10 -1
4 5 12 11 -1
5 6 13 12 -1
6 0 7 13 -1
7 8 9 12 13 -1
10 11 12 9 -1
">
<Coordinate point="
0 10 0,
0 6 0,
4 6 0,
4 0 0,
8 0 0,
8 6 0,
8 10 0,
0 10 4,
0 6 4,
4 6 4,
4 0 4,
8 0 4,
8 6 4,
8 10 4
">
</Coordinate>
</IndexedFaceSet>
<Appearance>
<Material diffuseColor="1 0 0"/>
</Appearance>
</Shape>
<!-- lantai 1 -->
<Shape>
<IndexedFaceSet coordIndex="
0 6 5 2 1 -1
2 5 4 3 -1
0 1 8 7 -1
1 2 9 8 -1
2 3 10 9 -1
3 4 11 10 -1
4 5 12 11 -1
5 6 13 12 -1
6 0 7 13 -1
7 8 9 12 13 -1
10 11 12 9 -1
">
<Coordinate point="
0 10 -1,
0 6 -1,
4 6 -1,
4 0 -1,
8 0 -1,
8 6 -1,
8 10 -1,
0 10 0,
0 6 0,
4 6 0,
4 0 0,
8 0 0,
8 6 0,
8 10 0
">
</Coordinate>
</IndexedFaceSet>
<Appearance>
<Material diffuseColor="0.7 0.7 0.7"/>
</Appearance>
</Shape>
<!-- lantai 2 -->
<Shape>
<IndexedFaceSet coordIndex="
0 6 5 2 1 -1
2 5 4 3 -1
0 1 8 7 -1
1 2 9 8 -1
2 3 10 9 -1
3 4 11 10 -1
4 5 12 11 -1
5 6 13 12 -1
6 0 7 13 -1
7 8 9 12 13 -1
10 11 12 9 -1
">
<Coordinate point="
0 10 4,
0 6 4,
4 6 4,
4 0 4,
8 0 4,
8 6 4,
8 10 4,
0 10 5,
0 6 5,
4 6 5,
4 0 5,
8 0 5,
8 6 5,
8 10 5
">
</Coordinate>
</IndexedFaceSet>
<Appearance>
<Material diffuseColor="0.7 0.7 0.7"/>
</Appearance>
</Shape>
<!-- bangunan -->
<Shape>
<IndexedFaceSet coordIndex="
0 6 5 2 1 -1
2 5 4 3 -1
0 1 8 7 -1
1 2 9 8 -1
2 3 10 9 -1
3 4 11 10 -1
4 5 12 11 -1
5 6 13 12 -1
6 0 7 13 -1
7 8 9 12 13 -1
10 11 12 9 -1
">
<Coordinate point="
0 10 5,
0 6 5,
4 6 5,
4 0 5,
8 0 5,
8 6 5,
8 10 5,
0 10 9,
0 6 9,
4 6 9,
4 0 9,
8 0 9,
8 6 9,
8 10 9
">
</Coordinate>
</IndexedFaceSet>
<Appearance>
<Material diffuseColor="1 0 0"/>
</Appearance>
</Shape>
<!-- atap -->
<Shape>
<IndexedFaceSet coordIndex="
1 2 5 6 0 -1
2 3 4 5 -1
0 1 7 -1
1 5 8 7 -1
6 0 7 8 -1
5 6 8 -1
2 5 8 -1
2 3 9 8 -1
3 4 9 -1
4 5 8 9 -1
">
<Coordinate point="
0 10 9,
0 6 9,
4 6 9,
4 0 9,
8 0 9,
8 6 9,
8 10 9,
2 8 13,
6 8 13,
6 2 13
">
</Coordinate>
</IndexedFaceSet>
<Appearance>
<Material diffuseColor="0.7 0.7 0.7"/>
</Appearance>
</Shape>
<!-- lab tekkim -->
<Shape>
<IndexedFaceSet coordIndex="
3 2 1 0 -1
1 2 6 5 -1
2 3 7 6 -1
3 0 4 7 -1
4 5 6 7 -1
0 1 5 4 -1
">
<Coordinate point="
10 0 0,
16 0 0,
16 6 0,
10 6 0,
10 0 4,
16 0 4,
16 6 4,
10 6 4
">
</Coordinate>
</IndexedFaceSet>
<Appearance>
<Material diffuseColor="1 0 0"/>
</Appearance>
</Shape>
<!-- atap -->
<Shape>
<IndexedFaceSet coordIndex="
0 1 2 3 -1
2 3 4 5 -1
4 5 1 0 -1
1 5 6 -1
5 2 9 -1
3 4 8 -1
4 0 7 -1
0 1 6 7 -1
7 6 5 4 -1
4 5 9 8 -1
2 3 8 9 -1
">
<Coordinate point="
10 0 4,
16 0 4,
16 6 4,
10 6 4,
10 3 4,
16 3 4,
14 1.5 6,
12 1.5 6,
12 4.5 6,
14 4.5 6
">
</Coordinate>
</IndexedFaceSet>
<Appearance>
<Material diffuseColor="0.7 0.7 0.7"/>
</Appearance>
</Shape>
</Scene>
Hasil :
Tampak Depan
Tampak Atas