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

page 129

done properly then z = depth in the view plane.)

• The point mapped to the computer screen can then be converted to a single pixel using a simple scaling calculation. (Note: It is not shown, but if a point is off the screen, then it cannot be drawn.)

S

 

= int

V

 

pixelsx

S

 

= int

V

 

pixelsy

x

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

y

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

 

 

 

x

width

 

 

 

 

y

 

 

 

 

 

 

 

 

 

 

 

 

height

where

 

 

 

 

 

 

 

 

 

 

 

 

S =

The screen pixel location

 

 

 

 

 

pixels

= the number of pixels on the screen

 

 

width, height =

the area of the transformed screen to view

Visual display can be done using,

-CRT monitors with Frame Buffer memory to store the image.

-plotters which draw one line at a time

-printers using special and proprietary graphics languages

For the sake of simplicity, the remaining graphics methods ignore some trivial operations such as screen coordinates, line clipping at edge of screen, etc.

The ‘z’ value after the perspective transform gives a relative depth of a point. This can be used later for depth sorting, or to set light intensity to cue the user to view depth.

12.3 LINE DRAWING

A wireframe object is simply rendered using the lines (straight, and curved) in a geometric model, then it is converted to screen coordinates using the Perspective Transformation.

The process is as pictured below,

page 130

Geometric

 

 

Convert

 

 

 

Clip lines

 

 

 

Draw Lines

Model

 

 

Lines to

 

 

 

that lead

 

 

 

Into Frame

(In Lines)

 

 

Screen

 

 

 

off screen

 

 

 

Buffer

 

 

 

Coords with

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Perspective

 

 

 

 

 

 

 

 

 

 

 

Transform

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If the geometric model is in some other form, such as CSG (Constructive Solids Geometry), it may have to be converted to lines before it may be used.

Advantages,

-Very fast, allows real time manipulation

-Easy to see features normally hidden

-Supported by almost all computer technology

-This display method works with most displays

Disadvantages,

-Drawings can become very crowded, very fast

-Hard to visualize solid properties

Almost all computer graphics packages offer a wireframe display option.

12.3.1 Hidden Lines

While the results seem similar, this method requires more sophisticated algorithms.

Polygons must be used for surface representation.

page 131

• The diagram below shows the basic steps in the method of rendering

Geometric

Polygons

Polygons are

Model (in

Transformed

roughly depth

Polygons)

using

sorted (may

 

Perspective

still overlap)

 

Transform

 

Polygon Lines

Lines are

 

which overlap

drawn into

 

are clipped

Frame Buffer

 

Advantages,

-similar advantages of wireframe

-overcomes the drawing crowding

-can be simplified if polygons do not overlap

Disadvantages,

-Consumes more computer time

-Does not support simple elemental geometric models

Clipping algorithms may be difficult, and often use tricks like subdividing polygons into triangles. (There are only 5 cases to consider with overlapping triangles)

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