SlideShare a Scribd company logo
glOrtho
 The glOrtho function describes a perspective matrix that produces a
parallel projection. The (left, bottom, near) and (right, top, near)
parameters specify the points on the near clipping plane that are mapped
to the lower-left and upper-rightcorners of the window, respectively,
assuming that the eye is located at (0, 0, 0). The far parameter specifies the
location of the far clipping plane. Both the near and the far can be either
positive or negative.
 Because OpenGL uses matrices to set up all its transformations, thecall to
gluOrtho2D() mustbepreceded by two setup functions:
 glMatrixMode(GL_PROJECTION);
 glLoadIdentity(); //toreset the matrix
World Window
 The space in which objects are described is called world coordinates (the
numbers used for x and y are those in the world, wherethe objects are
defined).
 World coordinates use the Cartesian xy-coordinatesystemused in
mathematics, based on whatever units are convenient.
 We define a rectangular worldwindow in these world coordinates.
 The world window specifies which part of the world should be drawn:
whichever part lies inside the window should be drawn, and whichever part
lies outside should be clipped away and not drawn.
 OpenGL does the clipping automatically.
 The function setWindow sets the world window size:
 void setWindow(GLdoubleleft, GLdouble right, GLdouble bottom, GLdouble
top)
 {
 glMatrixMode(GL_PROJECTION);
o glLoadIdentity();
o gluOrtho2D(left, right, bottom, top);
 }
Viewport
 In addition, we define a rectangular viewport in the screen window on the
display.
 A mapping (consisting of scalings [changesize] and translations [move
object]) between the world window and the viewportis established by
OpenGL.
 The objects inside the world window appear automatically at proper sizes
and locations inside the viewport(in screencoordinates, which arepixel
coordinates on the display).
 void setViewport(GLintleft, GLint right, GLint bottom, GLint top)
 {
 glViewport(left, bottom, right - left, top - bottom);
 }
 Calls: setWindow(-5.0,5.0, -0.3, 1.0);
o setViewport(0, 640, 0, 480);
 In myInit();
 We use natural coordinates for whatwe are drawing (the world window).
 OpenGL converts our coordinates to screen coordinates when we set up a
screen window and a viewport. The viewportmay be smaller than the
screen window. The default viewportis the entire screen window.
 The conversion requires scaling and shifting: mapping the world window to
the screen window and the viewport.
 Windows aredescribed by their left, top, right, and bottom values,
 w.l,
 w.t,
 w.r,
 w.b.
 Viewports aredescribed by the samevalues but in screen window
coordinates.
 v.l,
 v.t,
 v.r,
 v.b,
glMatrixMode
Specify which matrix is the current matrix
C Specification
void glMatrixMode( GLenum mode);
Parameters
Mode specifies which matrix stack is the target for subsequent matrix
operations. Three values are accepted:
GL_MODELVIEW,
GL_PROJECTION,and
GL_TEXTURE.
The initial value is GL_MODELVIEW.Additionally, if
the ARB_imaging extension is supported, GL_COLOR is also accepted.
Description
glMatrixMode sets the current matrix mode.
mode can assume one of four values:
GL_MODELVIEW applies subsequent matrix operations to the modelview
matrix stack.
GL_PROJECTION applies subsequent matrix operations to the projection
matrix stack.
GL_TEXTURE applies subsequent matrix operations to the texture matrix
stack.
GL_COLOR applies subsequent matrix operations to the color matrix stack.
glRotate
Multiply the current matrix by a rotation matrix
C Specification
void glRotated( GLdouble angle,
GLdouble x,
GLdouble y,
GLdouble z);
void glRotatef( GLfloat angle,
GLfloat x,
GLfloat y,
GLfloat z);
Parameters
Angle specifies the angle of rotation, in degrees.
x, y, z specify the x, y, and z coordinates of a vector, respectively.
Description
glRotate produces a rotation of angle degrees around the vector x y z .
The current matrix (see glMatrixMode) is multiplied by a rotation matrix
with the product replacing the current matrix, as if glMultMatrix were
called with the following matrix as its argument:
x 2 ⁡ 1 - c + c x ⁢ y ⁡ 1 - c - z ⁢ s x ⁢ z ⁡ 1 - c + y ⁢ s 0 y ⁢ x ⁡ 1 - c
+ z ⁢ s y 2 ⁡ 1 - c + c y ⁢ z ⁡ 1 - c - x ⁢ s 0 x ⁢ z ⁡ 1 - c - y ⁢ s y ⁢ z
⁡ 1 - c + x ⁢ s z 2 ⁡ 1 - c + c 0 0 0 0 1
Where c = cos ⁡ angle , s = sin ⁡ angle , and x y z = 1 (if not, the GL
will normalize this vector).
If the matrix mode is either GL_MODELVIEW or GL_PROJECTION,all objects
drawn after glRotate is called are rotated.
Use glPushMatrix and glPopMatrix to save and restore the unrotated
coordinate system.
Notes
This rotation follows the right-hand rule, so if the vector x y z points
toward the user, the rotation will be counterclockwise.
glTranslate
Multiply the current matrix by a translation matrix
C Specification
void glTranslated(GLdouble x,
GLdouble y,
GLdouble z);
void glTranslatef(GLfloat x,
GLfloat y,
GLfloat z);
Parameters
x, y, z specify the x, y, and z coordinates of a translation vector.
Description
glTranslate produces a translation by x y z . The current matrix is
multiplied by this translation matrix, with the product replacing the
current matrix, as if glMultMatrixc were called with the following
matrix for its argument:
1 0 0 x 0 1 0 y 0 0 1 z 0 0 0 1
If the matrix mode is either GL_MODELVIEW or GL_PROJECTION,all
objects drawn after a call to glTranslate are translated.
Use glPushMatrix and glPopMatrix to save and restore the untranslated
coordinate system.
glScale
Multiply the current matrix by a general scaling matrix
C Specification
void glScaled(GLdouble x,
GLdouble y,
GLdouble z);
void glScalef(GLfloat x,
GLfloat y,
GLfloat z);
Parameters
x, y, z specify scale factors along the x, y, and z axes, respectively.
Description
glScale produces a non-uniform scaling along the x, y, and z axes. The
three parameters indicate the desired scale factor along each of the three
axes.
The current matrix is multiplied by this scale matrix, and the product
replaces the current matrix.
If the matrix mode is either GL_MODELVIEW or GL_PROJECTION,all
objects drawn after glScale is called are scaled.
Use glPushMatrix and glPopMatrix to save and restore the unscaled
coordinate system.
Notes
If scale factors other than 1 are applied to the modelview matrix and
lighting is enabled, lighting often appears wrong. In that case, enable
automatic normalization of normals by calling glEnable with the
argument GL_NORMALIZE.
glutSolidSphere,glutWireSphere
glutSolidSphere and glutWireSphere render a solid or wireframe
sphere respectively.
Usage
void glutSolidSphere(GLdouble radius,
GLint slices, GLint stacks);
void glutWireSphere(GLdouble radius,
GLint slices, GLint stacks);
Parameters
Radius the radius of the sphere.
Slices the number of subdivisions around the Z axis (similar to lines of
longitude).
Stacks the number of subdivisions along the Z axis (similar to lines of
latitude).
Description
Renders a sphere centered at the modeling coordinates origin of the
specified radius.The sphere is subdivided around the Z axis into slices
and along the Z axis into stacks.
glutSolidCube, glutWireCube
glutSolidCube and glutWireCube render a solid or wireframe cube
respectively.
Usage
void glutSolidCube(GLdoublesize);
void glutWireCube(GLdoublesize);
Description
glutSolidCube and glutWireCube render a solid or wireframe cube
respectively. The cube is centered at the modeling coordinates origin
with sides of length size.
glutSolidCone, glutWireCone
glutSolidCone and glutWireCone render a solid or wireframe cone
respectively.
Usage
void glutSolidCone(GLdouble base, GLdouble height,
GLint slices, GLint stacks);
void glutWireCone(GLdouble base, GLdouble height,
GLint slices, GLint stacks);
Parameters
Base the radius of the base of the cone.
Height the height of the cone.
Slices the number of subdivisions around the Z axis.
Stacks the number of subdivisions along the Z axis.
Description
glutSolidCone and glutWireCone render a solid or wireframe cone
respectively oriented along the Z axis. The base of the cone is placed at
Z = 0, and the top at Z = height.The cone is subdivided around the Z
axis into slices, and along the Z axis into stacks.
glutSolidTorus, glutWireTorus
glutSolidTorus and glutWireTorus render a solid or wireframe torus
(doughnut) respectively.
Usage
void glutSolidTorus(GLdouble innerRadius,
GLdouble outerRadius,
GLint nsides, GLint rings);
void glutWireTorus(GLdouble innerRadius,
GLdouble outerRadius,
GLint nsides, GLint rings);
InnerRadius inner radius of the torus.
OuterRadius outer radius of the torus.
Nsides number of sides for each radial section.
Rings number of radial divisions for the torus.
Description
glutSolidTorus and glutWireTorus render a solid or wireframe torus
(doughnut) respectively centered at the modeling coordinates origin
whose axis is aligned with the Z axis.
glColor3f function
Sets the current color.
Syntax
void glColor3f(
GLfloat red,
GLfloat green,
GLfloat blue
);
Parameters
Red the new red value for the current color.
Green the new green value for the current color.
Blue the new blue value for the current color.
Returnvalue this function does not return a value.
glutCreateMenu
Creates a new pop-up menu.
Usage
int glutCreateMenu(void (*func)(int value));
Parameters
Func the callback function for the menu that is called when a menu entry
from the menu is selected. The value passed to the callback is
determined by the value for the selected menu entry.
Description
glutCreateMenu creates a new pop-up menu and returns a unique small integer
identifier. The rangeof allocated identifiers starts at one. The menu identifier
range is separate fromthe window identifier range. Implicitly, the currentmenu is
set to the newly created menu. This menu identifier can be used when
calling glutSetMenu.
When the menu callback is called becausea menu entry is selected for the menu,
the currentmenu willbe implicitly set to the menu with the selected entry before
the callback is made.

More Related Content

PPT
Windows and viewport
PPT
OpenGL Transformations
PPT
2d/3D transformations in computer graphics(Computer graphics Tutorials)
PDF
10CSL67 CG LAB PROGRAM 3
PPTX
Viewing transformation
PPT
Window to viewport transformation
PPT
computer graphics
PPTX
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Windows and viewport
OpenGL Transformations
2d/3D transformations in computer graphics(Computer graphics Tutorials)
10CSL67 CG LAB PROGRAM 3
Viewing transformation
Window to viewport transformation
computer graphics
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks

What's hot (18)

PPTX
Feature Extraction
PPTX
Second derivative and graphing
PPT
Trytten computergraphics(1)
PPTX
Matlab Feature Extraction Using Segmentation And Edge Detection
DOCX
Graphics practical lab manual
PDF
Unit 3
DOCX
Computer graphics lab assignment
PDF
The Ring programming language version 1.8 book - Part 107 of 202
PDF
Computer graphics lab manual
PDF
Ce 2009 Gate Paper Prsolutions08
PPTX
Window to viewport transformation&matrix representation of homogeneous co...
PDF
Computer Graphics Lab
PPT
Instancing
PDF
Sceneform SDK на практиці - UA Mobile 2019
DOCX
Computer graphics
PDF
Computer graphics practical(jainam)
PDF
2D Drawing
PDF
3D Curve Project
Feature Extraction
Second derivative and graphing
Trytten computergraphics(1)
Matlab Feature Extraction Using Segmentation And Edge Detection
Graphics practical lab manual
Unit 3
Computer graphics lab assignment
The Ring programming language version 1.8 book - Part 107 of 202
Computer graphics lab manual
Ce 2009 Gate Paper Prsolutions08
Window to viewport transformation&matrix representation of homogeneous co...
Computer Graphics Lab
Instancing
Sceneform SDK на практиці - UA Mobile 2019
Computer graphics
Computer graphics practical(jainam)
2D Drawing
3D Curve Project
Ad

Similar to computer graphics slides by Talha shah (20)

PDF
Getting Started with OpenGL ES
PPTX
3 d graphics with opengl part 2
PPT
CS 354 Object Viewing and Representation
PPTX
Computer Graphics Three-Dimensional Geometric Transformations
PDF
Open gl tips
PPTX
PPTX
Three dimensional geometric transformations
PDF
The Ring programming language version 1.6 book - Part 57 of 189
PPT
Introduction to OpenGL modern OpenGL program
PDF
Development with OpenGL and Qt
PDF
The Ring programming language version 1.5.2 book - Part 54 of 181
PPT
Computer Graphics involves technology to access. The Process transforms and p...
PDF
Geometric objects and transformations
PDF
2 transformation computer graphics
PDF
Lesson 2 - Drawing Objects
PPT
transformation in open GL. why use open GL modes
PDF
CG OpenGL Shadows + Light + Texture -course 10
PDF
Ujug07presentation
PPT
Introduction to open_gl_in_android
Getting Started with OpenGL ES
3 d graphics with opengl part 2
CS 354 Object Viewing and Representation
Computer Graphics Three-Dimensional Geometric Transformations
Open gl tips
Three dimensional geometric transformations
The Ring programming language version 1.6 book - Part 57 of 189
Introduction to OpenGL modern OpenGL program
Development with OpenGL and Qt
The Ring programming language version 1.5.2 book - Part 54 of 181
Computer Graphics involves technology to access. The Process transforms and p...
Geometric objects and transformations
2 transformation computer graphics
Lesson 2 - Drawing Objects
transformation in open GL. why use open GL modes
CG OpenGL Shadows + Light + Texture -course 10
Ujug07presentation
Introduction to open_gl_in_android
Ad

Recently uploaded (20)

PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Cell Types and Its function , kingdom of life
PDF
Classroom Observation Tools for Teachers
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Lesson notes of climatology university.
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
01-Introduction-to-Information-Management.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Sports Quiz easy sports quiz sports quiz
PDF
TR - Agricultural Crops Production NC III.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Microbial disease of the cardiovascular and lymphatic systems
PPH.pptx obstetrics and gynecology in nursing
STATICS OF THE RIGID BODIES Hibbelers.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Cell Types and Its function , kingdom of life
Classroom Observation Tools for Teachers
Renaissance Architecture: A Journey from Faith to Humanism
Lesson notes of climatology university.
Supply Chain Operations Speaking Notes -ICLT Program
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
VCE English Exam - Section C Student Revision Booklet
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
102 student loan defaulters named and shamed – Is someone you know on the list?
01-Introduction-to-Information-Management.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
O7-L3 Supply Chain Operations - ICLT Program
Sports Quiz easy sports quiz sports quiz
TR - Agricultural Crops Production NC III.pdf

computer graphics slides by Talha shah

  • 1. glOrtho  The glOrtho function describes a perspective matrix that produces a parallel projection. The (left, bottom, near) and (right, top, near) parameters specify the points on the near clipping plane that are mapped to the lower-left and upper-rightcorners of the window, respectively, assuming that the eye is located at (0, 0, 0). The far parameter specifies the location of the far clipping plane. Both the near and the far can be either positive or negative.  Because OpenGL uses matrices to set up all its transformations, thecall to gluOrtho2D() mustbepreceded by two setup functions:  glMatrixMode(GL_PROJECTION);  glLoadIdentity(); //toreset the matrix World Window  The space in which objects are described is called world coordinates (the numbers used for x and y are those in the world, wherethe objects are defined).  World coordinates use the Cartesian xy-coordinatesystemused in mathematics, based on whatever units are convenient.  We define a rectangular worldwindow in these world coordinates.  The world window specifies which part of the world should be drawn: whichever part lies inside the window should be drawn, and whichever part lies outside should be clipped away and not drawn.  OpenGL does the clipping automatically.  The function setWindow sets the world window size:  void setWindow(GLdoubleleft, GLdouble right, GLdouble bottom, GLdouble top)  {  glMatrixMode(GL_PROJECTION); o glLoadIdentity(); o gluOrtho2D(left, right, bottom, top);  }
  • 2. Viewport  In addition, we define a rectangular viewport in the screen window on the display.  A mapping (consisting of scalings [changesize] and translations [move object]) between the world window and the viewportis established by OpenGL.  The objects inside the world window appear automatically at proper sizes and locations inside the viewport(in screencoordinates, which arepixel coordinates on the display).  void setViewport(GLintleft, GLint right, GLint bottom, GLint top)  {  glViewport(left, bottom, right - left, top - bottom);  }  Calls: setWindow(-5.0,5.0, -0.3, 1.0); o setViewport(0, 640, 0, 480);  In myInit();  We use natural coordinates for whatwe are drawing (the world window).  OpenGL converts our coordinates to screen coordinates when we set up a screen window and a viewport. The viewportmay be smaller than the screen window. The default viewportis the entire screen window.  The conversion requires scaling and shifting: mapping the world window to the screen window and the viewport.  Windows aredescribed by their left, top, right, and bottom values,  w.l,  w.t,  w.r,  w.b.  Viewports aredescribed by the samevalues but in screen window coordinates.  v.l,  v.t,  v.r,  v.b,
  • 3. glMatrixMode Specify which matrix is the current matrix C Specification void glMatrixMode( GLenum mode); Parameters Mode specifies which matrix stack is the target for subsequent matrix operations. Three values are accepted: GL_MODELVIEW, GL_PROJECTION,and GL_TEXTURE. The initial value is GL_MODELVIEW.Additionally, if the ARB_imaging extension is supported, GL_COLOR is also accepted. Description glMatrixMode sets the current matrix mode. mode can assume one of four values: GL_MODELVIEW applies subsequent matrix operations to the modelview matrix stack. GL_PROJECTION applies subsequent matrix operations to the projection matrix stack. GL_TEXTURE applies subsequent matrix operations to the texture matrix stack. GL_COLOR applies subsequent matrix operations to the color matrix stack. glRotate Multiply the current matrix by a rotation matrix C Specification void glRotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
  • 4. void glRotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z); Parameters Angle specifies the angle of rotation, in degrees. x, y, z specify the x, y, and z coordinates of a vector, respectively. Description glRotate produces a rotation of angle degrees around the vector x y z . The current matrix (see glMatrixMode) is multiplied by a rotation matrix with the product replacing the current matrix, as if glMultMatrix were called with the following matrix as its argument: x 2 ⁡ 1 - c + c x ⁢ y ⁡ 1 - c - z ⁢ s x ⁢ z ⁡ 1 - c + y ⁢ s 0 y ⁢ x ⁡ 1 - c + z ⁢ s y 2 ⁡ 1 - c + c y ⁢ z ⁡ 1 - c - x ⁢ s 0 x ⁢ z ⁡ 1 - c - y ⁢ s y ⁢ z ⁡ 1 - c + x ⁢ s z 2 ⁡ 1 - c + c 0 0 0 0 1 Where c = cos ⁡ angle , s = sin ⁡ angle , and x y z = 1 (if not, the GL will normalize this vector). If the matrix mode is either GL_MODELVIEW or GL_PROJECTION,all objects drawn after glRotate is called are rotated. Use glPushMatrix and glPopMatrix to save and restore the unrotated coordinate system. Notes This rotation follows the right-hand rule, so if the vector x y z points toward the user, the rotation will be counterclockwise. glTranslate Multiply the current matrix by a translation matrix C Specification void glTranslated(GLdouble x, GLdouble y,
  • 5. GLdouble z); void glTranslatef(GLfloat x, GLfloat y, GLfloat z); Parameters x, y, z specify the x, y, and z coordinates of a translation vector. Description glTranslate produces a translation by x y z . The current matrix is multiplied by this translation matrix, with the product replacing the current matrix, as if glMultMatrixc were called with the following matrix for its argument: 1 0 0 x 0 1 0 y 0 0 1 z 0 0 0 1 If the matrix mode is either GL_MODELVIEW or GL_PROJECTION,all objects drawn after a call to glTranslate are translated. Use glPushMatrix and glPopMatrix to save and restore the untranslated coordinate system. glScale Multiply the current matrix by a general scaling matrix C Specification void glScaled(GLdouble x, GLdouble y, GLdouble z); void glScalef(GLfloat x, GLfloat y, GLfloat z); Parameters x, y, z specify scale factors along the x, y, and z axes, respectively. Description
  • 6. glScale produces a non-uniform scaling along the x, y, and z axes. The three parameters indicate the desired scale factor along each of the three axes. The current matrix is multiplied by this scale matrix, and the product replaces the current matrix. If the matrix mode is either GL_MODELVIEW or GL_PROJECTION,all objects drawn after glScale is called are scaled. Use glPushMatrix and glPopMatrix to save and restore the unscaled coordinate system. Notes If scale factors other than 1 are applied to the modelview matrix and lighting is enabled, lighting often appears wrong. In that case, enable automatic normalization of normals by calling glEnable with the argument GL_NORMALIZE. glutSolidSphere,glutWireSphere glutSolidSphere and glutWireSphere render a solid or wireframe sphere respectively. Usage void glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); void glutWireSphere(GLdouble radius, GLint slices, GLint stacks); Parameters Radius the radius of the sphere. Slices the number of subdivisions around the Z axis (similar to lines of longitude). Stacks the number of subdivisions along the Z axis (similar to lines of latitude). Description Renders a sphere centered at the modeling coordinates origin of the specified radius.The sphere is subdivided around the Z axis into slices and along the Z axis into stacks. glutSolidCube, glutWireCube
  • 7. glutSolidCube and glutWireCube render a solid or wireframe cube respectively. Usage void glutSolidCube(GLdoublesize); void glutWireCube(GLdoublesize); Description glutSolidCube and glutWireCube render a solid or wireframe cube respectively. The cube is centered at the modeling coordinates origin with sides of length size. glutSolidCone, glutWireCone glutSolidCone and glutWireCone render a solid or wireframe cone respectively. Usage void glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); void glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); Parameters Base the radius of the base of the cone. Height the height of the cone. Slices the number of subdivisions around the Z axis. Stacks the number of subdivisions along the Z axis. Description glutSolidCone and glutWireCone render a solid or wireframe cone respectively oriented along the Z axis. The base of the cone is placed at Z = 0, and the top at Z = height.The cone is subdivided around the Z axis into slices, and along the Z axis into stacks. glutSolidTorus, glutWireTorus glutSolidTorus and glutWireTorus render a solid or wireframe torus (doughnut) respectively. Usage void glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint nsides, GLint rings); void glutWireTorus(GLdouble innerRadius,
  • 8. GLdouble outerRadius, GLint nsides, GLint rings); InnerRadius inner radius of the torus. OuterRadius outer radius of the torus. Nsides number of sides for each radial section. Rings number of radial divisions for the torus. Description glutSolidTorus and glutWireTorus render a solid or wireframe torus (doughnut) respectively centered at the modeling coordinates origin whose axis is aligned with the Z axis. glColor3f function Sets the current color. Syntax void glColor3f( GLfloat red, GLfloat green, GLfloat blue ); Parameters Red the new red value for the current color. Green the new green value for the current color. Blue the new blue value for the current color. Returnvalue this function does not return a value. glutCreateMenu Creates a new pop-up menu. Usage int glutCreateMenu(void (*func)(int value)); Parameters Func the callback function for the menu that is called when a menu entry from the menu is selected. The value passed to the callback is determined by the value for the selected menu entry. Description
  • 9. glutCreateMenu creates a new pop-up menu and returns a unique small integer identifier. The rangeof allocated identifiers starts at one. The menu identifier range is separate fromthe window identifier range. Implicitly, the currentmenu is set to the newly created menu. This menu identifier can be used when calling glutSetMenu. When the menu callback is called becausea menu entry is selected for the menu, the currentmenu willbe implicitly set to the menu with the selected entry before the callback is made.