Professional Documents
Culture Documents
CSL7450 C9
CSL7450 C9
IIT Jodhpur
Semester 1, 2022-2023
sites.google.com/iitj.ac.in/cg2022-2023/
September 5, 2022
Window: The rectangular region of the world that is visible from the
camera (virtual).
Viewport: The rectangular region where the window will be
displayed on the display.
How do we find a transformation that maps a window into a
viewport?
umax − umin
a =
xmax − xmin
vmax − vmin
b =
ymax − ymin
Matrix Representation:
umax −umin
1 0 umin xmax −xmin 0 0 1 0 −xmin
vmax −vmin
A = 0 1 vmin 0 ymax −ymin 0 0 1 −ymin
0 0 1 0 0 1 0 0 1
Matrix of Transformation:
umax −umin max −umin
−xmin uxmax
xmax −xmin 0 −xmin + umin
vmax −vmin max −vmin
A= 0 ymax −ymin −ymin yvmax −ymin + vmin
0 0 1
void glClearColor(r, g, b, w) Sets the current clearing color for use in clearing color
buffers in RGBA mode.
void glClear(GLbitfield mask) Although the glClearColor command assigns a color to the
display window, it does not put the display window on the screen. To get the assigned
window color displayed, we need to invoke this OpenGL function.
glColor3f (0.0, 0.4, 0.2) In addition to setting the background color for the display
window, we can choose a variety of color schemes for the objects we want to display in a
scene.
void gIBegin(GLenum mode) Marks the beginning of a vertex-data list that describes a
geometric primitive. The type of primitive is indicated by mode.
void gIEnd(void) Marks the end of a vertex-data list.
oid glPointSize(GLfloat size) Sets the width in pixels for rendered points; size must be
greater than 0.0 and by default is 1.0.
void gIFlush(void) Forces previously issued OpenGL commands to begin execution, thus
guaranteeing that they complete in finite time.