GLART Week 3 Assignment

Explore perspective and ortho modes: 1) Create a simple scene and render it in perspective set the camera position with gluLookAt(). NOTE: gluLookAt() should be called right after you call glMatrixMode(MODELVIEW) and glLoadIdentity(). Experiment with gluPerpective(). Try different FOV values to see how it affects your scene. You may try glFrustum() if you want a more advanced approach. Look at the cityscape samples on the Week 3 notes page for a starting point. 2) Use ortho mode by either: -- drawing the same scene in ortho. You could switch to ortho when the user hits a key or draw the scene in a second viewport in ortho. -- switch to ortho mode and draw a frame around the scene or add a flat layer over the scene. In games this is called a Heads Up Display or HUD. This can be a simple GL_LINE_STRIP rectangle drawn near the edge of the viewport. More details: Look at the sample programs on the week3 syllabus page (the "cityscape" examples). These programs draw a minimal scene in perspective and in ortho, and switch between the two when a key is hit, or show both views in two viewports. For a scene you could try one of these ideas or invent something of your own. 1) Use GL_TRIANGLE, GL_TRIANGLE_STRIP or GL_POLYGON to create a petal shape, then rotate and repeat that shape to render a flower. Repeat these flowers to create a field of varied sized flowers. 2) Use renderCube() or renderPlane() to create a simple city scene (it doesn't have to be elaborate). You could use the arrow keys to change gluLookAt() parameters to move the camera around the scene. Try adding a rectangular frame around the view, as if you are looking out a window at the scene. This can be a simple GL_LINE_STRIP rectangle drawn near the edge of the viewport. The rectangle frame stays in place as your viewpoint moves in the scene. 3) Use GL_QUAD_STRIP or GL_TRIANGLE_STRIP to make a growing spiral ribbon shape. Add randomness or other math functions to have the ribbon grow in varied shapes. You could use the JOApp.drawCircle(float innerRadius, float outerRadius, int numSegments) function as a starting point.