Computer Graphics II Final Report
Computer Graphics II: 4003-571 or 4005-762
Instructor: Reynold Bailey
Siu Choi Kevin Cheng
Title: Billiards with Ray Tracer
Website URL: http://kvnchgcgiiproject.blogspot.com/
Introduction and Problem:
Originally, I had planned to create a fully playable Billiards game that can be controlled with the mouse and keyboard in real-time. However after implementing the basic animation portion of the game, I realized that my original goals would be impossible. With just two balls on the screen and set at a distance, I was still only getting around half a screen a second. Thus I had to revise my goals and objectives for this project.
• Original Objectives
o Enable animation on the ray tracer
o Implement a basic physic engine
o Implement a keyboard and mouse interface
o Stage setup input
• Revised Objectives
o Enable animation on the ray tracer
o Implement a basic physic engine
o Video capture of animation
o Stage setup input
Approach:
One of the main reasons why I decided on doing billiards for my project was because we were already rendering a ball and table for our ray tracer assignment. Due to the similarities and convenience, I had decided to use my ray tracer program from our homework assignments as a foundation for my project. I modified varies classes in our ray tracer homework and added the various features I had set out to do for my project.
After doing some research I learnt how to animate my ray tracer fairly easily. I simply needed to add my display() function into a glutIdleFunc() function. Have the display() function call an animate() function that modify the location and velocity of the objects based on the simple physic engine I have implemented.
Technical Details :
Everything was done in Visual Studio 2005, using Visual C++ and the Glut OpenGL graphics library. I used the bounding sphere collision detection algorithm for collision detection and implemented a simple 2D pure elastic collision physics engine that uses a vector math class that I have modified to do its calculation. Lastly, I have implemented video capture, by using the CGLToMovie library that I downloaded online and modified slightly.
Results:
The results can be viewed by opening the various videos that I have recorded in the Video folder located within the zip file submitted into the dropbox and you can run the application to create new videos and animation by editing the input.txt file.
Future Enhancements:
This application is no longer a billiard application so it would make sense that I implement 3D collision handling instead. Implementing a better input method and maybe improve upon the efficiency of the algorithm would be nice.
Platform and installation/compilation instructions:
All the files needed, will be in the CGII-Project.zip file submitted in the dropbox. You can view the video files with any media players that can play .avi files. If you have the Visual Studio 2005 or 2008 and Glut OpenGL library installed, you can open the project by either doubling clicking on Ray Tracer 2005.vcproj or Ray Tracer 2008.vcproj depending on your version of Visual Studio.
Monday, May 18, 2009
Subscribe to:
Comments (Atom)