Chicago State University Lighting Cameras Object Oriented Graphics Worksheet
Description
Unformatted Attachment Preview
graphics
1.
We¥ at the point where procedural code is nearly unreadable. You¥ going to make
classes for object types you¥ going to draw, and so your nit&unction should just call
âject1.init()!nd render should be âject1.draw()/r something similar.
Restructure your code so classes define the geometry (vertices), colour/material properties
of an object, copying the relevant parts to buffers, the current transformation matrix etc.
Note that using objects like this and instancing starts to become a bit of a nuisance so don
worry about that for this. Make classes/objects to define at least 3 object types, create at
one of 2 of those, and 2 of the 3rd (probably cuboid, square based pyramid, triangle pyramid,
but could be something else).
2. You¥ going to create 4 objects (cuboids) that are bound to each other, you could think of
this as a character with a torso, head, right arm, left arm. Head on the top, torso in the
middle, arms, like arms. If you rotate the whole thing, they all rotate together, etc. This
character should have adjustable angles between arm and torso in both toward or away
from the torso, and forward-back. (don worry about making the head separately posable),
control those angles with sliders. The scene should have fixed light source (pick a position
that helps you see where the object is).
3. This character should also have a perspective camera.
4. Change the light in #2 so that it can be moved, this can either be with the mouse or with
sliders/buttons. (I recommend sliders just for ease of control).
5. Try a fragment based light model rather than vertex based light model. In the lab we used
per vertex, the textbook example has èadedsphere2!s an example of using a fragment
shader for the lighting calculations (note the calculations aren much different). Make sure
you¥ fixed the rotation behaviour of lab 7
No theory this time because it should be obvious why you¥ being asked to do things in this way,
and hopefully obvious how this builds towards a program/engine.
Purchase answer to see full
attachment
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."