Sie sind auf Seite 1von 12

X3D 2012

X3D
TUJUAN
Mahasiswa mampu mengetahui dasar dasar pemrograman XML dan dapat
menggunakan X3D Editor

PENDAHULUAN
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 kooerdinat dan transformasi.

LANGKAH KERJA
A. Bangun -bangun
Box
Script :
<Scene>
<Shape>
<Box size='3 3 3'/>
<Appearance>
<Material/>
</Shape>
</Scene>

X3D 2012

Tampilan :

Sphere
Script :
<Scene>
<Shape>
<Sphere radius='2'/>
<Appearance>
<Material/>
</Appearance>
</Shape>
</Scene>

X3D 2012

Tampilan :

Cone
Script :
<Scene>
<Shape>
<Cone bottomRadius='1.5' height='2.5'/>
<Appearance>
<Material/>
</Appearance>
</Shape>
</Scene>

X3D 2012

Tampilan :

Cylinder
Script :
<Scene>
<Shape>
<Cylinder height='2.5' radius='1.5'/>
<Appearance>
<Material/>
</Appearance>
</Shape>
</Scene>

X3D 2012

Tampilan :

B. Warna
Adding Color
<Scene>
<Shape>
<Cone bottomRadius='1' height='3'/>
<Appearance>
<Material diffuseColor="0 0 1"/>
</Appearance>
</Shape>
<Shape>
<Sphere radius='1.2'/>
<Appearance>
<Material diffuseColor="1 0 0"/>
</Appearance>
</Shape>
<Shape>
<Box size='2 2 2'/>
5

X3D 2012

<Appearance>
<Material diffuseColor="0 1 0"/>
</Appearance>
</Shape>
</Scene>
Tampilan:

Adding Image
Script :
<Scene>
<Shape>
<Box/>
<Appearance>
<Material/>
<ImageTexture url="Sunset.jpg"/>
</Appearance>
</Shape>
</Scene>

X3D 2012

Tampilan:

C. Transformasi
Rotate
Script :
<Scene>
<Shape>
<Box size='1 2 3'/>
<Appearance>
<Material diffuseColor="1 0 0"/>
</Appearance>
</Shape>
<Transform translation="3 0 0" rotation="1 0 0 1.57" >
<Shape>
<Box size='3 2 1'
<Appearance>
<Material diffuseColor="0 1 0"/>
</Appearance>
</Shape>
</Transform>
7

X3D 2012

</Scene>

Tampilan:

Translate
Script :
<Scene>
<Shape>
<Box size='1 2 3'/><!--Add a single geometry node here-->
<Appearance>
<Material diffuseColor="1 0 0"/>
</Appearance>
</Shape>
<Transform translation="3 3 0">
<Shape>
<Box size='3 2 1'/><!--Add a single geometry node here-->
<Appearance>
<Material diffuseColor="0 1 0"/>
8

X3D 2012

</Appearance>
</Shape>
</Transform>
</Scene>
Tampilan:

Extrusion
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 0 1"/>
</Appearance>
</Shape>
</Scene>

X3D 2012

Tampilan:

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,
10

X3D 2012

4 0 0,
4 0 6,
0 0 6,
0 5 0,
4 5 0,
4 5 6,
0 5 6,
2 6 1,
265
">

</Coordinate>
</IndexedFaceSet>
<Appearance>
<Material diffuseColor="0 1 0"/>
</Appearance>
</Shape>
</Scene>

Tampilan:

11

X3D 2012

Elevation Grid
Script :
<Scene>
<Shape>
<ElevationGrid xDimension="7" xSpacing="2"
zDimension="7" zSpacing="2"
height="1 3 1 2 0 1 2
0121021
1312012
0121021
1312012
0121021
1 3 1 2 0 1 2">
</ElevationGrid>
<Appearance>
<Material diffuseColor="0 1 0"/>
</Appearance>
</Shape>
</Scene>

Tampilan:

12

Das könnte Ihnen auch gefallen