Вы находитесь на странице: 1из 5

Nama : Muttawadhie Rachman

NIM : 360801006

Jurusan : Teknik Informatika

UAS : Komputer Grafik

SOAL I
(clipping eksplisit 2D)
Andaikan sebuah jendela persegi dengan koordinat kartesian berpusat di (0,0) yang panjang =
2satuan dan sebuah garis yang bermula dari P1 (-3/2,-1) ke P2 (3/2,2), maka :
a. Tentukan semua nilai perpotongan garis dengan jendela!
b. Tentukan nilai-nilai perpotongan yang ditolak!
Panjang Sisi = 2 satuan
Y
Garis yang bermula dari P1 (-3/2, -1) Ke P2 (3/2, 2)
Jawab : 1

-1
1
X

-1

a. Nilai perpotongan garis

Left : XL = -1 Bottom : YB = -1
Y = m (XL –X1) + Y1 X = X1 + (1/m) (YB –Y1)
Y = 1 (-1 – (-3/2)) + (-1) X = (-3/2) + (1) (-1 – (-1))
Y = 1 (½) -1 X = (-3/2) + (1) (0)
Y=½-1 X = (-3/2) + 0
Y = -1/2 X = -3/2
X > XL = Tertolak (Rejected)
Right : XR = 1 Top : YT = 1
Y = m (XR –X1) + Y1 X = X1 + (1/m) (YT –Y1)
Y = 1 (1 – (-3/2)) + (-1) X = (-3/2) + (1) (1 – (-1))
Y = 1 (5/2) - 1 X = (-3/2) + (1) (2)
Y = (5/2) – 1 X = (-3/2) + 2
Y = (5/2) – (2/2) X = (-3/2) + (4/2)
Y = 3/2 X=½
Y > YT = Tertolak (Rejected)

b. Nilai – nilai perpotongan yang di tolak


- Right : XR = 1 ; Y = 3/2
- Bottom : YB = -1 ; X = -3/2

SOAL II
(mid-point subdivision algorithm)
Consider the (1024 x 1024) window in the screen coordinate. The line has end point P3 (-307,631)
and P4 (820,-136) in screen coordinates.
a. Give the end point code for P3 and P4!
b. Give the intersection points the line with the windows!
c. Write your conclusion!

Jawab :
a. The end point code for P3 and P4
P3 = 0001
P4 = 0100

b. The intersection points the line with the windows

P3 P4 Pm Ket
-307,631 820,-136 256,5;247,5 Simpan PmP4
Lanjut P3Pm
-307,631 256,5;247,5 -26,439 Lanjut PmP4
-26,439 256,5;247,5 115,343 Lanjut P3Pm
-26,439 115,343 44,391 Lanjut P3Pm
-26,439 44,391 9,415 Lanjut P3Pm
-26,439 9,415 -9,427 Lanjut PmP4
-9,427 9,415 0,421 Berhasil
P3 P4 Pm Ket
-307,631 820,-136 256,5;247,5 Simpan P3Pm
Lanjut PmP4
256,5;247,5 820,-136 538,56 Lanjut PmP4
538,56 820,-136 679,-40 Lanjut P3Pm
538,56 679,-40 608,8 Lanjut PmP4
608,8 679,-40 643,-16 Lanjut P3Pm
608,8 643,-16 625,-4 Lanjut P3Pm
608,8 625,-4 616,2 Lanjut PmP4
616,2 625,-4 620,-1 Lanjut P3Pm
616,2 620,-1 618,0 Berhasil
SOAL IV

Jelaskan yang dimasksud dengan :

a. Perpective projection

b. Rendering

c. Simple Illumination Model

d. Gouraud Shading

e. Transparency

f. Shadows

Jawab :

a. Perspective projction
Such a mapping from three dimensions onto two dimensions.

b. Rendering is the process of generating an image from a model (or models in what
collectively could be called a scene file), by means of computer programs. A scene file
contains objects in a strictly defined language or data structure; it would contain geometry,
viewpoint, texture, lighting, and shading information as a description of the virtual scene.
The data contained in the scene file is then passed to a rendering program to be processed
and output to a digital image or raster graphics image file. The term "rendering" may be by
analogy with an "artist's rendering" of a scene. Though the technical details of rendering
methods vary, the general challenges to overcome in producing a 2D image from a 3D
representation stored in a scene file are outlined as the graphics pipeline along a rendering
device, such as a GPU. A GPU is a purpose-built device able to assist a CPU in performing
complex rendering calculations. If a scene is to look relatively realistic and predictable
under virtual lighting, the rendering software should solve the rendering equation. The
rendering equation doesn't account for all lighting phenomena, but is a general lighting
model for computer-generated imagery. 'Rendering' is also used to describe the process of
calculating effects in a video editing file to produce final video output.

c. Simple Illmumination Model


The intensity of the light reflected to the observer’s eye. Invoked globally, the light that
reaches a oint by reflection from, or transmission through, other objects in the scene, as well
as light incident from any light source.

d. Gouraud shading, named after Henri Gouraud, is a method used in computer graphics to
simulate the differing effects of light and colour across the surface of an object. In practice,
Gouraud shading is used to achieve smooth lighting on low-polygon surfaces without the
heavy computational requirements of calculating lighting for each pixel. Gouraud first
published the technique in 1971 in IEEE Transactions on Computers
e. Transparency is possible in a number of graphics file formats. The term transparency is
used in various ways by different people, but at its simplest there is "full transparency" i.e.
something that is completely invisible. Of course, only part of a graphic should be fully
transparent, or there would be nothing to see. More complex is "partial transparency" or
"translucency" where the effect is achieved that a graphic is partially transparent in the same
way as colored glass. Since ultimately a printed page or computer or television screen can
only be one color at a point, partial transparency is always simulated at some level by
mixing colors. There are many different ways to mix colors, so in some cases transparency
is ambiguous. In addition, transparency is often an "extra" for a graphics format, and some
graphics programs will ignore the transparency.

f. Shadows As the position of the observer and the light source sparate, shadow significantly
influence heating, air conditioning, and solar power calculation for building and space craft
design application.

Вам также может понравиться