Scotty 3D
3D graphics software package
Scotty3D is the coursework project for 15462/662(Computer Graphics) at Carnegie Mellon University. It is a 3D graphics software package including components for interactive rasterization rendering, mesh editing, realistic path tracing, and dynamic animation.
Demo Video
Project Info

Platform: Windows

Date of Completion: 2023.05

Course: CMU 15442/662

Category: 3D Graphics Software

Contribution: Individual Project
Rasterization rendering
The first component of the project involves rasterized rendering. During this phase, I focused on developing various features that encompassed MVP transformation, line rendering, triangle rendering, mipmapping, supersampling, and more. This intricate process allowed me to gain a comprehensive understanding of how graphics are rendered on a computer.
Mesh Editing
MeshEdit serves as the primary component of Scotty3D, enabling 3D modeling, subdivision, and mesh processing. This powerful tool empowers users to transform simple cube models into stunning, organic 3D surfaces represented by highquality polygon meshes. Moreover, MeshEdit facilitates the import, modification, and export of industrystandard COLLADA files, enabling seamless integration with other computer graphics software.
â€‹
During the development process, I implemented a significant portion of the local mesh operations supported by Scotty3D. These operations include EdgeFlip, EdgeCollapse, VertexExtrude, FaceBevel, and more. Implementing these operations provided me with a comprehensive understanding of the Halfedge data structure, which acts as the "glue" connecting various elements such as vertices, edges, and faces within the mesh.
â€‹
Furthermore, I incorporated several global remeshing algorithms into the system, such as CatmullClark Subdivision, Loop Subdivision, and Simplification. These algorithms allow for flexible modification and optimization of models, mirroring the capabilities found in wellknown 3D software.
â€‹
Through these implementations, I have gained valuable experience in working with complex mesh operations and have deepened my understanding of advanced modeling techniques and algorithms commonly employed in the 3D graphics industry.
Path Tracing
PathTracer is (as the name suggests) a simple path tracer that can render scenes with global illumination. I implemented the BVH(Bounding Volume Hierarchy) algorithm as the data structure to store the mesh information and accelerate the frequent ray intersection query that path tracing requires.
â€‹
The images below show the visualization of the bounding box hierarchy of a bunny model. The image from left to right indicates the bounding box at level 4, 7, and 10.
Also, the efficient BVH structure accelerates the visibility query for the bunny model from 2 minutes to less than 0.5 seconds on an RTX 3070 machine.
â€‹
Later on, I implemented the global illumination algorithm using path tracing. I also applied BSDF for Lambertian, mirror, and glass material to test the correctness and efficiency of my algorithm.
To optimize the path tracing algorithm even more, I implemented a basic importance sampling strategy  light sampling. The basic idea behind importance sampling is that for each point the algorithm prefers to shoot rays in the direction that has light sources because these are the samples that actually contribute to the final rendering result and therefore have better rendering quality even with fewer samples.
Lastly, I implemented Environment Lighting, which is a new type of light source: an infinite environment light. An environment light is a light that supplies incident radiance from all directions on the sphere. The intensity of incoming light from each direction is defined by a texture map parameterized by phi and theta.
â€‹
Pixels with higher luminance in the texture map will have a higher probability to be sampled from. For this purpose, I implemented an inversion sampling algorithm by calculating the luminance PDF and CDF of the texture map and then sampling pixels based on the CDF.
Animation
Animation is the final module of the project. I utilized the Spline Interpolation algorithm to calculate the interpolation values, enabling the implementation of keyframe animation. In terms of Skeleton Kinematics, I employed the Gradient Descent algorithm to compute partial derivatives, allowing for the implementation of both Forward Kinematics (FK) and Inverse Kinematics (IK) motion models.
â€‹
For Skinning, I employed the Linear Blend Skinning algorithm, utilizing the Halfedge data structure mentioned earlier to control the positioning of the points.
â€‹
Lastly, I implemented a particle system that simulates various aspects, including physical collisions, particle lifetimes, and more.
What I Learned
Throughout my exploration of computer graphics, I have gained valuable knowledge and skills in various aspects of the field. I have learned about rasterized rendering techniques, including MVP transformation, triangle rendering, mipmapping, and supersampling. Additionally, I have delved into 3D modeling and mesh processing, mastering mesh editing, subdivision, and global remeshing algorithms. Lastly, I have acquired expertise in creating realistic visual effects through the implementation of global illumination algorithms, such as path tracing, and utilizing data structures like BVH for efficient ray intersection calculations. Overall, this experience has equipped me with the tools to create visually compelling digital environments.