ch-4 (1)
ch-4 (1)
Attributes of graphics
primitives
Colour Attribute
Point Attributes
Line Attributes
Fill-Area Attributes
RGB: the colour is defined as the combination of its red, green and
blue components.
RGBA: the colour is defined as the combination of its red, green and
blue components together with an alpha value, which indicates
the degree of opacity/transparency of the colour.
Points are the simplest type of primitive so the only attributes we can
modify are the colour and size of the point.
To change the size of points in pixels we use:
glPointSize(size);
All points in OpenGL are drawn as squares with a side length equal
to the point size.
The default point size is 1 pixel.
Line width
1. Line Width
The simplest and most common technique for increasing the width of a
line is to plot a line of width 1 pixel, and then add extra pixels in either
the horizontal or vertical directions.
In other words, if the bit in the pixel mask is a 1, we plot a pixel, and if
First we must enable the line stipple feature of OpenGL using the
glBegin(GL_POLYGON);
glVertex2i(350,250);
glVertex2i(400,300);
glVertex2i(400,350);
glVertex2i(300,250);
glEnd();
Thank you .