CPE471 Final Project - Centroidize

General Description

The original purpose of my project was to render a 3D representation of two bounding curves that are further bounded by a "depth" function. Following this step, the user would attempt to guess the axis of rotation of the object from a top down view. The user would then receive a score based on the proximity to the actual, calculated centroid / axis (not paying attention to the z-value of the player's click). This calculation required the implementation of at least single integral and possibly double integrals.

Unfortunately, what I do have is completely different. Although it was not for a lack of trying -- roughly forty (40) hours spent on the project in the past week, the various computational problems bested me. My current project represents the 2D shape bounded by "y = x" and "y = (x-2)^2" which is then shaded by the depth function "z = x + y." See below.

Sample Display

Knowledge Deepened

Although my project may not have achieved what I set out to, I enjoyed the process even during the struggle. Most of my time was spent drawing up, writing pseudocode for, and testing algorithms for calculating various aspects of the shapes, but in regards to graphics material, I certainly gained a deeper understanding of the following:


Rotated Sample Display

Controls

W and S keys control vertical rotation.
A and D keys control horizontal rotation.
[SPACE] resets the rotation values to 0 thus resetting the original view.

External Library

For this assignment, I used "exprtk," a library used for parsing strings into expressions. Additionally, the library contains a function for integrating expressions. Unfortunately however, exprtk provided almost no useful documentation for a source file of approximately 30,000lines which made it difficult to use. That being said, I was still able to implement a generic function to fill a buffer object array given three expression strings.

Thank you for a great quarter, Dr. Wood!