Final Project - Math 155B - Student: Chih Liang

Comments

 
 

Forward/Backward Kinematics -
The scorpion will strike the object with its venomous tail. The tail end is moved toward the target if it is within range and field of view. The animation is performed by rotating and translating each joint segment of the tail. To move the tail end toward the target, I use math and geometry to calculate the best angles for each link that will land the tail at the target. Thus, each angle is incremented/decremented to its final angle every frame. This method of backward kinematics, which takes advantage of the simple geometry of the tail, is different from applying inverse kinematics with Jacobian matrix

Shadow Mapping -
The objects will cast its shadow on anything (even itself), not just on flat surface. The shadow mapping is achieved by rendering the scene twice, first from light perspective and the second from the normal perspective. The Z-depth of the frame buffer from the first scene is stored. After rendering second scene to the frame buffer, each pixel is unprojected to find its x-y-z coordinates, which is then projected to find the pixel location and the depth value in the second scene. When the stored depth value associated with the pixel in the second scene is less than the depth value projected, the pixel is darkened and thus shadowed. Though shadow mapping is faster than ray-tracing, it has more flaws.

Mouse Clicking –
The mouse can be used to click on the screen to select the target location. I use UNPROJECT function to locate the position and draw the target there. But, the target must be not too far and not too close to the scorpion and within 90 degrees in front of it.


Press:
'f' to toggle between smooth and flat surfaces.
'p' to fill polygons or not.
's' to turn on or off shadow mapping.
'SPACE to pause or unpause the animation.
't' to enable or disable texture mapping.
'-' to decrease the striking speed of the scorpion tail.
'+' to increase the striking speed of the scorpion tail.
'~' to change the perspective to the light's point of view.
UP or DOWN or LEFT or RIGHT to rotate the scene.
'r' to reset the scene.
HOME or END to move the light closer or farther.
PAGE_UP or PAGE_DOWN to rotate the light.


If I had more time, I would implement these additional features:
1. Move and rotate the scorpion toward the target to position itself before strking.
2. Speed up rendering with shadow mapping.
3. There are still many to be fixed(though I have fixed some bugs).
4. Create more objects and textures to beautify the scene.
5. Implement inverse kinematics with Jacobian matrix.
6. Strike target with both of the scorpion's clamps.

List of figures

·