Professional Documents
Culture Documents
Computer Graphics Pract
Computer Graphics Pract
Raster scan and random scan are the mechanisms used in displays for rendering
the picture of an object on the screen of the monitor. The main difference
between raster scan and random scan lies in the drawing of a picture where the
raster scan points the electron beam at the entire screen but incorporating just
one line at a time in the downward direction. On the other hand, in the random
scan, the electron beam is guided on just those regions of the screen where the
picture actually lies.
COMPARISON
Electron beam Swept across the screen and Directed to the portions
mathematical functions
The Raster Scan is a scanning technique in graphics monitor where the electron
beam is moved along the screen covering one line at a time from top to bottom.
The beam intensity is set at high and low levels as the beam sweeps around the
screen to generate a pattern of illuminated spots.
Refresh buffer or frame buffer is then used to save the picture definition, more
specifically the memory area contains the combination of intensity values for
various screen points. These stored intensities are fetched from refresh buffer
and represented on the screen one scan line at a time. The fundamental unit for
defining a single screen point is known as Pixel or Pel (Picture element).
The raster scan systems are appropriate for the realistic display of scenes as
these systems are capable of saving the intensity data for each screen point
where subtle shading and colour patterns can also be involved. However, the
television sets and printers are examples of other systems.
A typical system having a screen resolution of 1024 by 1024 and contain 24 bits
per pixel can consume 3 megabytes for the frame buffer. In black-and-white
systems, the frame buffer is known as a bitmap where only one bit per pixel is
consumed while the frame buffer of systems with multiple bits per pixel is called
as a pixmap. The rate of refreshing on raster-scan displays is operated at the rate
of 60-80 frames per second.
The Random scan works in a completely different manner to the raster scan
where the electron beam is pointed to merely those areas of the screen where the
picture is to be drawn. However, it only involves one line at a time when
drawing a picture that is why it is also known as the vector or calligraphic
display. The component lines of an object by a random scan is drawn in the way
as shown in the diagram below.
The refresh rate of a random scan relies on the number of lines that are to be
showed on the screen. Similar to the raster scan the random scan also stores the
picture definition as a set of line drawing commands using some sort of
medium known as refresh display file. The other names for refresh file display
are display list, display program or refresh buffer. A system displays a certain
picture by revoluting the group of commands in the display file and drawing
each component line after each turn. After processing all line drawing
commands, the system cycle is sent to the first line command.
Conclusion
When it comes to refreshing rate, the raster scan has higher refresh rate about 60
to 80 times per second while random scan consumes less time for refreshing the
screen, i.e., 30 to 60 times per second. Raster scan can also use interlaced refresh
method which is not used in the random scan.
Cohen Sutherland line clipping algorithm
For a given line extreme point (x, y), we can quickly find its region's four-bit
code. Four-bit code can be computed by comparing x and y with four values:
(x_min, x_max, y_min and y_max).
import java.io.*;
class Main {
return code;
}
while (true) {
if ((code1 == 0) && (code2 == 0)) {
// If both endpoints lie within rectangle
accept = true;
break;
}
else if ((code1 & code2) != 0) {
// If both endpoints are outside rectangle,
// in same region
break;
}
else {
// Some segment of line lies within the
// rectangle
int code_out;
double x = 0, y = 0;
2. Perspective Projection :
Perspective projections are used by artist for drawing three-dimensional scenes.
In Perspective projection lines of projection do not remain parallel. The lines
converge at a single point called a center of projection. The projected image on
the screen is obtained by points of intersection of converging lines with the
plane of the screen. The image on the screen is seen as of viewer’s eye were
located at the centre of projection, lines of projection would correspond to path
travel by light beam originating from object.
Two main characteristics of perspective are vanishing points and perspective
foreshortening. Due to foreshortening object and lengths appear smaller fromthe
center of projection. More we increase the distance from the center of
projection, smaller will be the object appear.
The distance of the object from The distance of the object from the
3 the center of projection is center of projection is finite.
infinite.
SR.N Parallel Projection Perspective Projection
O
4 Parallel projection can give the Perspective projection cannot give the
accurate view of object. accurate view of object.
5 The lines of parallel projection The lines of perspective projection are not
are parallel. parallel.
The Storyboard layout is an outline of the action. It defines the motion sequence
as a set of basic events that are to take place. Depending on the type of animation
to be produced, the storyboard could consist of a set of rough sketches or it could
be a list of the basic ideas for the motion.
An object definition is given for each participant in the action. Objects can
bedefined interms of basic shapes, such as polygons or splines. In addition, the
associatedmovements for each object are speeded along with the shape.
A keyframe is a detailed drawing of the scene at a certain time in the animation
sequence. Within each key frame, each object is positioned according to the time
for that frame. Some key frames are chosen at extreme positions in the action;
others are spaced so that the time interval between key frames is not to great. More
key frames are specified for intricate motions than for simple, slowly varing
motions.
In-between frames are the intermediate frames between the key frames. The
nurnber of in-betweens needed is determined by the media to be used to display
theanimation. Film requires 24 frames per second, and graphics terminals are
refreshedat the rate of 30 to 60 frames per second. Typically, time intervals for
themotion are set up so that there arr from three to five in-betweens for each pair
ofkey frames.
GENERAL COMPUTER-ANIMATION FUNCTIONS
RASTER ANIMATIONS
On raster systems, we can generate real-time animation in limited applications
using raster operations. Sequences of raster operations can be executed to produce
real-time animation of either two-dimensional or three-dimensional objects, as
long as we restrict the animation to motions in the projection plane. Then no
viewing or visible- surface algorithms need be invoked.The animation is then
accomplished by changing the color-table values so that the object is "on"at
successively positions along the animation path as the preceding position is set-to
the background intensity
COMPUTER-ANIMATION LANGUAGES