Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(EOD).Software topics.pdf
Скачиваний:
18
Добавлен:
23.08.2013
Размер:
1.55 Mб
Скачать

page 127

12. MATHEMATICAL ELEMENTS OF COMPUTER GRAPHICS

• To put geometries on the computer screen we depend on basic mathematical tools and methods.

12.1 INTRODUCTION

After a geometric model is constructed, it must be displayed (rendered).

Rendering is mainly limited by computer hardware, and the geometric model.

The main methods for doing computer graphics are,

-Wire Frame

-Wire frame with hidden line removal

-Polygon drawing (backface, and clipping)

-Shaded polygons

-Raytracing

As the scene becomes more complicated, the computing time becomes longer, but the picture becomes more realistic.

The basic history of research on geometric modeling can be summarized as,

-2D computer drafting - Mid 60s

-2.5 D - Late 60s

-3D Wire Frame Systems - Early 70s

-3D Surface Systems - Mid 70s

-3D Primitive Solids - Early to Mid 70s

-3D Arbitrary Solids - Mid to Late 70s

12.2 PIXELS

The fundamental task is converting lines, points and surfaces in 3D space, to be depicted on a 2D screen using colored pixels, or printed on paper with dots, or plotted with pens.

A computer screen is made up of an square array of points (pixels). The points can be lit up. When viewed as a whole these points make a picture.

One major problem is making a map between a geometry model (a collection of points) and what we see on the screen. This is accomplished with the perspective transform.

page 128

12.2.1 The Perspective Transform

A set of basic viewing parameters may be defined (variations are also common),

-The point the Eye is looking at, and from which direction

-The focal distance to the viewing plane

-The size of the viewing plane being focused on

-Which direction is up for the eye

 

 

 

 

 

 

 

 

 

1

0

0

0

T =

0

1

0

0

0

0

1

0

 

 

–( VRPx + VPNxVdist)

–( VRPy + VPNyVdist)

–( VRPz + VPNzVdist)

1

 

 

 

 

 

 

 

V =

VPNy2 + VPNz2

 

 

RUP = VUPx

2 + VUPy

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

0

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

VPNy

VUPx

 

 

 

 

 

 

 

VPNz

VPNy

 

 

 

 

 

 

 

 

 

VPNx

 

 

 

 

 

-------------

-------------

0

0

 

 

0

0

 

 

 

V

 

0

0

 

 

 

RUP

RUP

 

 

 

 

 

----------------

----------------

 

 

 

 

 

 

 

 

 

 

 

 

 

VUPx

VPNy

 

 

 

Rx

=

 

 

V

V

 

 

Ry

=

0

 

1

0

0

Rz

=

0

0

 

 

VPNy

VPNz

 

 

 

 

 

 

 

 

 

 

 

-----------------

-------------

 

 

0

0

 

 

VPN

x

0

V

0

 

 

 

RUP

RUP

 

 

 

 

 

----------------

----------------

 

 

 

 

 

 

 

 

 

 

 

 

0

0

1

0

 

 

 

 

V

V

 

 

 

 

0

 

0

0

1

 

 

 

 

0

0

0

1

 

 

 

 

 

0

0

0

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S = AP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

where,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A = Transform Matrix

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

P = Point in real/model space

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S =

Point on screen

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

VRP = The perspective viewing point

VPN = The view plane normal

VUP = The view up vector

As seen above the viewing parameters can all be combined using simple matrix multiplication which will convert a point in 3D space to a point on the screen.

The process of drawing an object is merely applying this transformation to each point in the 3D model, then using the resulting (x, y) point on the 2D screen. (Note: If this transformation is

Соседние файлы в предмете Электротехника