View the step-by-step solution to:

Computing Science CMPT 361 Instructor: Richard (Hao) Zhang Summer 2012 Simon Fraser University Assignment #2 Written part due: Thursday, July 5, in...

I need answers for all these problems please. For programming part, please use at least OpenGL 3.0., so must use the buffers and shaders. The functions with older OpenGL version such as glBegin, glEnd, etc are not allowed.

Computing Science CMPT 361 Summer 2012 Instructor: Richard (Hao) Zhang Simon Fraser University Assignment #2 Written part due: Thursday, July 5, in class Programming part due: Thursday, July 5, at 23:45 electronically On the cover page of your written submission, write and sign the following statement: “I have read and understood the policy concerning collaboration on homework and lab assignments”. Without such a signed statement, your work will not be marked. A sample cover page can be found on the course webpage. You need to explain your work. Problem 1 (10 marks): Controlling a robotic arm You will write a program called myrobot to display and control a robotic arm to pick up and move an object. Check out the sample code in the following directory: http://www.cs.unm.edu/~angel/BOOK/INTERACTIVE_COMPUTER_GRAPHICS/ SIXTH_EDITION/CODE/CHAPTER08/ and look into example1.cpp and associated shaders. You are to build your program based on it. Read Chapter 8.3 of the textbook to get an understanding of the setup. The robot is composed of three parts: the base, a lower arm, and an upper arm. First, run the code and see what it does. Click on the middle button to display the menu and see what options you have. Try mouse clicks and see the effects. Pay special attention to the transformations used to control which part to rotate and how the rotation is done. No collision detection needs to be implemented in this assignment. You have two tasks to complete: Two views: Add an additional menu item which alternates its value between “top view” and “side view” when the item is selected. This menu item specifies which view to use for the robot. Side view allows you to view the robot from the side and top view is from the top. For the top view, select your view and parallel projection parameters properly so that in top view, o The whole robot is within your view for any possible robot movement. o The robot base is located at the center of the window. Fetch an object: Modify your program so that it accepts seven arguments: . /myrobot old_x old_y old_z new_x new_y new_z <-tv | -sv> The last argument specifies whether “top” (-tv) or “side view” (-sv) is used. When the program is run, it should first display a solid sphere (with its material and reflectance properties at your choice) centered at (old_x, old_y, old_z) whose diameter matches the side length of top face of the upper arm (see figure below).
Background image of page 1
Then starting from its initial position, the robot base and arms should undergo appropriate motion (i.e., rotations) so that the tip of the upper arm touches the sphere. At this moment, the sphere should be picked up and attached to the upper arm and then it is moved, by having the robot base and arms undergo appropriate motions, to the new location (new_x, new_y, new_z). When this is done, the robot should return to its initial position and the sphere should remain at its new location (it does not drop due to gravity). You may assume that the sphere will be given at a location that is reachable by the robot and the new location is also reachable. The motion of the robot should be smooth and shown at appropriate speed. What to submit: You should modify the sample program into your own code named myrobot.cpp , which implements the two views and “fetch”. Submit this program along with the shaders as well as a MAKEFILE. You can also include a README file for any documentation and/or instructions. Problem 2 (10 marks): Create an interesting (static) scene You are to create and render an interesting scene using OpenGL. The scene should just be static. We will judge your work by its creativity , sophistication , and/or realism . Note that you do not have to achieve all these attributes. The goal of this assignment problem is to allow you to feel more comfortable with what OpenGL has to offer, expand the basic use of OpenGL so far, and let your effective and imaginative use of OpenGL functionalities take over you can still WOW us with just one month of exposure to graphics programming! Follow the link below, you can see some scenes created by past students. http://www.cs.sfu.ca/~haoz/teaching.html Here is a partial list of things you might want to check out and learn to use: Predefined primitives, such as sphere, teapot, etc., either wireframe model or solid model; these are all provided by GLUT. Feel free to create your own objects using polygons, i.e., polygonal meshes. There are many free mesh models that can be downloaded from the internet. Visibility: learn how to turn on depth test; your scene looks more real this way Lighting, material, and texture. Check out the textbook to get a preview. Transformation and hierarchical models. Your program/scene is terminated by pressing the ‘q’ key.
Background image of page 2
Show entire document

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question