Robotics C++ Physics II AP Physics B Electronics Java Astronomy Other Courses Summer Session  

Exercises

 

Exercise 1

Concepts-Lines

Exercise 2

Polygons and Triangles

Exercise 3

Concepts and Graphics

Exercise 4
Primitives

 

 

Exercise 1

Part a.

Questions

 

Part b.

Run the code provided in the examples (lines.c) to produce the following output - turn in output and code

 

Exercise 2

Duplicate the following with a background of Stars in the Sky (see below, Exercise 3, part b)

 

Exercise 3

Part a: Concepts

  Define the following

 

    Front-facing polygon

 

 

    Winding

 

 

    Culling

 

 

    Convex Polygon

 

 

    Concave Polygon

 

 

    Normal Vector

 

 

    Vertex Array

 

 

 

  What is accomplished by the following code? Be specific

 

    #define drawOneLine(x1,y1,x2,y2)  glBegin(GL_LINES);  \

       glVertex2f ((x1),(y1)); glVertex2f ((x2),(y2)); glEnd();

 

Part b: Graphics

Duplicate the following 3 OpenGL graphics approximately)

    Stars in the Sky

    Blue Triangle Twins Behind Red Rectangle

    Battle of the In-Color Line Invaders

Output 1: Stars in the Sky

 

Output 2: Blue Triangle Twins Behind Red Rectangle

Output 3: Battle of the In-Color Line Invaders

 

Exercise 4

¢ OpenGL Primitives are shown below.

¢ Modify the code provided in the text and notes as appropriate to reproduce the following

      Ø Triangle Strip

      Ø Triangle Fan

      Ø Quad Strip

¢ Use any color you wish

¢ Turn in both output and code.

¢ You can use 3 separate programs to simplify the lab.