3D, Transforms, Textures

Practicing Transforms

Reading

Read Chapter 4.

Class startup

[~]$ cd cs40/examples
[examples]$ cp -r ~adanner/public/cs40/examples/w04-3D ./
[examples]$ git add w04-3D
[examples]$ git commit -m "w04 start"

Switch to your working branch, open qtcreator, and set your executable to sphere in w04-3D/cube.
Initial Explorations
vColor as attribute
GL_DEPTH_TEST, GL_DEPTH_BUFFER_BIT
shaders and rotation matrices

When you first run your program, you should get a wireframe outline of a square. You can rotate using the x,y, and z keys.

Examine the method updatePolyMode and see where it is called. Find out how to change the mode and toggle the various features.

Find out how to toggle the sphere

Examine GL_CULL_FACE

Texture Mapping
go to the fragment shader and uncomment the first fragColor line, while commenting out the third line. recompile and run. Woot!