Monday, May 18, 2009

Final Report

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.

Wednesday, April 15, 2009

Midterm Update

Computer Graphics II Midterm Update
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/

From the project proposal:
Project Objectives
Gain a better understanding on animation and physics engine.
Create an interactive GUI that can affect 3D objects in an 3D environment
Gain a better understanding on how to animate things using a ray tracer.
Project Timeline
Week 3 - 4: Research on Physics engine and Ray tracer animation
Week 5 - 6: Implement framework for the project
Week 7 - 8: Implement physics engine into the ray tracer
Week 9 - 10: Complete physics engine and ray tracer and effects
Week 11: Prepare and give presentation

What has been done so far?
I have gotten myself familiar with different collision detections and have written a few demo programs and have successfully got accurate collision detection working.
I have decided to use my current Ray Tracer's project framework to implement my project. It already has all the different type of objects that I need and have most of the framework already. I have already added the various variables I will need to implement the collision detection and I will later implement other physics related class and methods once I run into them.

An assessment of your (team's) progress
I am working by myself, and so far I have managed to accomplish everything that I had set forth to do in my proposal. However, I was just informed that the presentations will be due on the 10th week so I think I should probably move the presentation preparations up to week 9. So far I haven't run into any problems, but I can see how I have just completed the easy part and the hard part is implementing the physic engine into the ray tracer.

Revised Time-line
Week 3 - 4: Research on Physics engine and Ray tracer animation
Week 5 - 6: Implement framework for the project
Week 7 - 8: Implement physics engine into the ray tracer
Week 9 - 10: Complete project and Prepare presentation

Sunday, March 29, 2009

Project Proposal

Computer Graphics II Project Proposal
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/

Summary
The goal of my project is to implement a simply billiards game that follows Newtonian physics and rendered by the ray tracer I will implement throughout the length of this course. This project will focus on the 3D modeling and transformation aspect of the rendering pipeline.

Objectives
1. Gain a better understanding on animation and physics engine.
2. Create an interactive GUI that can affect 3D objects in an 3D environment
3. Gain a better understanding on how to animate things using a ray tracer.
System and Software
I plan on only using my laptop and Visual Studio to complete this project. I plan on using C++ and OpenGL for my code.

Project Components
Physics engine:
create an physics engine that will animate the ball collision as realistic as possible.
GUI:
create an easy to use and intuitive interface for the user to play billiards.
Ray Tracer:
I am still unsure how animation really works with ray tracing but judging from the previous projects that I have seem, I believe it is possible to use ray tracing to implement a billiard game.
I will try to render the objects in the game as realistic as possible.

Project Timeline
Week 3 – 4: Research on Physics engine and Ray tracer animation
Week 5 – 6: Implement framework for the project
Week 7 – 8: Implement physics engine into the ray tracer
Week 9 – 10: Complete physics engine and ray tracer and effects
Week 11: Prepare and give presentation

Final Presentation
I plan on doing a PowerPoint presentation on my project follow by a demonstration of my work.