I have attached a word document explaining all of the details. Also I am using Microsoft Visual 2005
This is what needs to be done,
Modify the OpenGL application as follows:
• Put your name in the title bar of the application with the following lines of code after the ShowWindow call in WinMain (in [login to view URL]) :
char str[32];
sprintf(str, "%s", "your name goes here");
SetWindowText(HDialog, str);
Be sure to include the header file for the sprintf function at the top of [login to view URL], if not included:
#include <stdio.h>
• Change the OpenGL window's background color to light blue or grey by changing the call to the glClearColor function in CGfxOpenGL.cpp.
i.e. change the following line of code near the beginning of bool CGfxOpenGL::Init() :
glClearColor(0.0, 0.5, 0.0, 0.0); //green background
• Change the color of the sphere to red using glColor3f(1, 0, 0); just before the sphere is drawn. It is done before the sphere is made because the glColor3f command presets the color state, before drawing.
Note: The sphere of radius 1 centered at the origin (0,0,0) is then drawn with the function
gluSphere(quadric, 1.0f, 20, 20).
It has 20 slices (similar to lines of longitude) and 20 stacks (similar to lines of latitude) when drawn.
• Add a second, different colored sphere to the scene. Place this second sphere in a different location by calling glTranslatef(15, 0, 0); before
drawing the sphere with gluSphere. It is done before the sphere is made because the glTranslatef command moves the drawing state, before drawing. Thus, this last part has a total of three commands: change the color using glColor3f, then translate the scene using glTranslatef, and then draw the new sphere using gluSphere.
Build and run the modified project. The output should look something like this: