CSCE 4813 Computer Graphics Programming Project 2 Due Friday 02/14/2020 Programming Project 3 .

CSCE 4813 Computer Graphics Programming Project 2

CSCE 4813 Computer Graphics Programming Project 2 Due Friday 02/14/2020 Programming Project 3 Due Monday 02/24/2020 1. Problem Statement: The goal of this two-part programming project is to design and implement a video game called angry bricks modeled after the well known angry birds game. In our game, the player will grab onto a brick that is displayed on the lower left side of the screen with their mouse, drag it to the left, and when they release the mouse, the brick will slingshot towards a target on the right. As the brick moves across the screen, it will rotate in three dimensions, and fall towards the ground due the effects of gravity. When a brick hits the left or right wall it will bounce in the opposite direction. The brick will finally stop when it hits the ground. The goal of this game is to select a target, and see if you can slingshot the brick to that location. Project 2 Creating and displaying the brick Your first task is to create an OpenGL program that displays a colorful brick at a fixed location on the screen using the display callback. To do this, you will have to calculate the (x,y,z) locations of all 8 corners of the brick, and define the 6 faces of the brick using polygons with different colors. Once you have this working, you can create a mouse callback function that captures the (x,y) location of the mouse, and redraws the colorful brick at that location. As you move your mouse around and click in different locations, the brick should be erased from the screen and redrawn in the new location. The key to this process will be converting from the (x,y) window coordinates into (x,y,z) object coordinates for display purposes. Finally, you need to create a motion callback function that captures the (x,y) window coordinates of the mouse as you drag it across the screen. As the mouse moves, you should redraw the brick at the corresponding (x,y,z) location in object coordinates. For debugging purposes, you may want to print out the (x,y) window and (x,y,z) object coordinates as they are changing. Project 3 Simulating and displaying brick motion In order to simulate brick motion you need to calculate the velocity vector from your slingshot. To do this, you can record the (x1,y1) location where the mouse was clicked, and the (x2,y2) location where the mouse was released, and subtract these to get the direction and speed of the brick in object coordinates. Your next task is to use the idle callback or the timer callback to simulate physics and update the (x,y,z) location of the brick at each time step and redisplay the brick. The tricky part here is to find a step size that results in natural looking motion. If the step size is too large, the brick will move too quickly. If the step size is too small, the brick will move in slow motion. In order to simulate the brick bounce you will have to figure out when the brick hits the left or right wall, and update the brick position and velocity accordingly. To keep things simple, you can assume that the brick hits the wall squarely and bounces off perfectly in the opposite direction without change in speed and without introducing any strange brick rotations. Finally, it would be nice to see the brick rotate slowly as it moves across the screen. To do this, you should keep track of the current location and rotation angles for the brick at each time step. Then you can use the glLoadIdentity, glRotatef, and glTranslatef functions to update the GL_MODELVIEW matrix prior to drawing the brick. This will make your brick rotate as it moves. Again, you need to select your rotation step size so it is not too fast and not too slow. 2. Design: There are several design tasks you must complete for this project. First, you must design your brick model (a collection of 6 polygons should be enough). Next, you need to decide where to position the brick, and how to detect when the user has clicked on the brick. To do this, you will need to convert from screen coordinates to object coordinates. Your next task is to work out the equations needed to simulate physics so you can calculate the (x,y,z) locations of the brick as it is flying across the screen. If you ignore the effects of wind on the brick, it should follow a parabolic path. Finally, you need to figure out how you will detect when the brick hits the wall or the ground, and adjust the position and velocity accordingly. 3. Implementation: This semester we will be using C++ and OpenGL to implement all of our programming projects. If you are using a Mac with Xcode installed, then you can download the src.tar file and compile the sample graphics code using the enclosed Makefile. If you are using a PC, then your best option would be to download and install a Linux VM from the departments website. The instructions for doing this are posted in README file the Source Code page of the class website. Once you have Linux and OpenGL installed, you can compile your graphics program using g++ -Wall project2.cpp -o project2-lGL -lGLU -lglut. Using one of the programs in the source directory as a starting point, you can add code to the display function to display your brick on the screen. You will need to make use of the mouse callback to detect when the user has selected the brick, and the motion callback to track the motion of the mouse as the user drags it to the left, and the idle or timer function to update the location and orientation of the brick after it has been released by the slingshot towards the target. Remember to use incremental development and good programming style when creating your program. Choose good names for variables and constants, use proper indenting for loops and conditionals, and include clear comments in your code. Also, be sure to save backup copies of your program somewhere safe. Otherwise, you may end up retyping your whole program if something goes wrong. 4. Testing: Test your program to check that it operates correctly for all of the requirements listed above. Also check for the error handling capabilities of the code. Try your program with several input values, and save screen shots of your output in jpeg images for inclusion in your project report. 5. Documentation: When you have completed your C++ program, write a short report using the project report template describing what the objectives were, what you did, and the status of the program. Does it work properly for all test cases? Are there any known problems? Save this report to be submitted electronically. 6. Project Submission: In this class, we will be using electronic project submission to make sure that all students hand their programming projects and labs on time, and to perform automatic plagiarism analysis of all programs that are submitted. When you have completed the tasks above go to Blackboard to upload your documentation (a single docx or pdf file), and all of your C++ program files. Do NOT upload an executable version of your program. The dates on your electronic submission will be used to verify that you met the due date above. All late projects will receive reduced credit: 10% off if less than 1 day late, 20% off if less than 2 days late, 30% off if less than 3 days late, no credit if more than 3 days late. You will receive partial credit for all programs that compile even if they do not meet all program requirements, so handing projects in on time is highly recommended. 7. Academic Honesty Statement: Students are expected to submit their own work on all programming projects, unless group projects have been explicitly assigned. Students are NOT allowed to distribute code to each other, or copy code from another individual or website. Students ARE allowed to use any materials on the class website, or in the textbook, or ask the instructor and/or GTAs for assistance. This course will be using highly effective program comparison software to calculate the similarity of all programs to each other, and to homework assignments from previous semesters. Please do not be tempted to plagiarize from another student. Violations of the policies above will be reported to the Provost's office and may result in a ZERO on the programming project, an F in the class, or suspension from the university, depending on the severity of the violation

View less

Custom Paper Help
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.