'A Simple One' - Revisited ========================== We once again go back to the first program to reinforce some of the principles. This time around we provide means to not only change the color of the square, but also the position of the OGL window (where the square is rendered) and the size (width and height) of the rendering window can be changed. Change the values as you desire and click on execute and see what happens. The Reset button sets all parameters to default positons. You should now look at the actual code of the program in front of you. The following additional things come to light : o As before glColor3f(red, green, blue); controls the amount of each color used in drawing the square o Scroll down on the code screen. At the very bottom we see a call to glutInitWindowSize() This takes as arguements 'width' and 'size' When you changed the 'Window Width' and the 'Window Height' parameters using the sliding scale these were the variables getting affected. The glutInitWindowSize() thus sets the initial dimensions of the rendering screen. o Also we see a function glutInitWindowPositon() This function takes as its arguements 'winX' and 'winY'. When you changed the 'Window X' and the 'Window Y' parameters using the sliding scale these were the variables getting affected. The glutInitWindowPosition() places your OGL window at the positon as defined by the parameters 'winX' and 'winY' passed to it. Also notice that the upper left hand corner of the screen corresponds ot the (0,0) positon. SUMMARY ======= o glColor3f() is used to change the color of the objects being rendered o glutInitWindowSize() sets the size in terms of width and height of the OGl window o glutInitWindowPositon() sets the positon of the OGL window on your monitor. TRY THIS EXERCISE ================= Change the window width to 500. Leave the window height at 250. What happens? Our square which we drew is now a rectangle!! Why?? We will learn more about aspect ratios, and reshape functions so that the geometry of the object is maintained even when the window is dragged or resized etc. This we shall do in future sections.