Project 2b
©Jorg Peters
Points: 25+10 (+10 +5 BONUS)
Purpose
Learn hierarchical transformations and lighting
Task 4: Keyboard interaction
Points: 5+5+5+10
Moving the robot arm:
- Base (translate): Select the base for translation
with key t. The whole model should
slide on the XZ plane according to the arrow keys.
-
Base (rotate): Select the base using key
r. The base, joint and arms should
rotate about the Y direction when pressing
the left or right arrow keys (J1).
-
Arm1: Select arm1 using key
1. The arm
(and the other connected arm) should rotate up
and down when using the arrow keys (one
end is fixed at the center of the red base (J2).
- Arm2: Select Arm2 using key
2. The arm should rotate up
and down when using the arrow keys (one end is fixed at the center
of the joint) (J3).
Indicate the selected part by drawing it in a brighter color.
Task 5: Light up the scene
Points: 10
Add two lights to the scene.
For each light, supply position, diffuse color, ambient color
and specular color.
Position the lights near the camera so that one light comes from
the left and another one from the right.
You are free to choose any light colors and positions as long
as the scene looks good.
Set diffuse and ambient material of the objects to the color of the object.
Set specular as a multiple (eg one tenth) of the diffuse color.
BONUS: Teleporting
Points: 10
When s is pressed
have a Platonic solid exit the tip of Arm2
with tangent equal to Arm2 and derivative
in length equal to the length of Arm2.
The solid follows an arc according to Newton's law under gravity
until it hits the grid. (Hint: use the BB-form of degree 2)
Animate the projectile and, on impact,
move the robot arm to the impact location.
BONUS: Picking
Points: 5
Implement picking for selecting the parts of the robot arm. Use your knowledge acquired in Project 1. You might also find the original tutorial on picking helpful.
WHAT TO SUBMIT
- Your modified source files
(cpp, shaders, html, obj, etc)
- A link to a screen capture of your
running program showcasing the implementation of all of the tasks using
recordit (Mac, Win)
or similar software.
-
openGL:
Use a "models" folder within the top-most level of the source repo ("ogl-master").
If you need to deviate specify the location in the readme file.
-
WebGL: store models in the `resources' folder parallel to the .html files.
Otherwise, you must specify the location in the readme file.