OpenGL代写:CS680 3D Modeling

改进上次作业的OpenGL代码,实现在3D空间中进行交互模拟。

Requirement

This assignment will introduce you to 3D modeling and transformations in OpenGL. You will develop a program that allows the user to control a simulated insect, scorpion, or spider.

The emphasis in this assignment is on using hierarchical transformations in OpenGL to define legs and other moving parts of your creature. You will design your own creature using 3D primitives.

This assignment is challenging. Start programming early.

Get Some Files

We do not provide a template for this assignment. Instead, you are given an example of a working program from a past year’s assignment P2: modeling a human hand. You can adapt this working example program if you’d like.

Note: You are to model an insect, scorpion, or spider in this year’s assignment. Your model should have a structure that is similar to the anatomy of an insect, scorpion, or spider. In other words, your model’s parts, legs, and joints should be based upon a real insect, scorpion, or spider.

Java files

PA2.tar source files for a working PA2 from 2011. The description of that assignment and its keyboard interface are available here: 2011 PA2.

Example Scorpion Animation Tool

An example of a fully functioning scorpion animation tool is available here. Note that you will design your own 3D model for an insect, spider, or scorpion. Search the Web for photos.

Note that you are expected to define your own keyboard interface that is best for controlling the joint angles of your creature. Your interface may be different from the example programs provided here. The user interface for the example program is provided through mouse buttons and keyboard:

  • A, B, C, D keys: toggle which of the scorpion’s RIGHT legs are active for rotation
  • a, b, c, d keys: toggle which of the scorpion’s left legs are active for rotation
  • F/f keys: toggles when the RIGHT/left front claws are active for rotation
  • T key: toggles when the tail is active for rotation
  • 1,2,… keys: toggle which of the joints are active for rotation.
  • X, Y, Z keys: set current rotation axis to x, y, or z axis for rotation
  • Up-arrow, down-arrow keys: change the angle at the active joints
  • Left mouse button click and drag motion: change the viewing angle
  • O key: outputs the angle values for all the joints in the scorpion
  • P key: cycles through test poses for demo
  • R key: resets the model and the viewing angle
  • Q key: quits

The Code You Write

You are expected to write a program that will simulate a 3D insect, spider, or scorpion.

  1. Use OpenGL to construct a 3D insect, spider, or scorpion model from cylinders and/or ellipsoids. The model need not be anatomically accurate, but each limb should have at least three joints. You can model the body as a single ellipsoid.
  2. Write code that enables the user to change the angles at each joint in the creature’s body model via the keyboard interface that you define.
  3. Limit the angles at each joint within reasonable ranges so that creature’s legs, neck, head, and any other parts don’t bend in unnatural ways!

Required for CS680 Students

Add eyes to the creature model. Make the eyes automatically follow the mouse position.

Extra Credit

Apply a texture map to your model that makes surface appear more realistic.

Test Cases

As mentioned above, you are to add a keyboard input ‘P’ that cycles through 5 (five) different poses of the creature that you defined.

Demo

Part of your grade for this programming assignment will be based on your giving a short demo (5 minutes) during the lab session after the due date. You will be expected to talk about how your program works, and we will see how well your program performs.