Sprinkled Donut
By Annie Wang→Features:
Donut shape:
- File(s):
src/donut.cpp,src/donut.h - Details: The donut shape was created using sphere.cpp as a base, adding values R and r for the outer and inner radius of the shape. x, y and z calculations incorporated R and r and the normal of the donut was calculated since it is not the same as the spherical coordinates.
- File(s):
Sprinkles:
- File(s):
sprinkled_donut.cpp - Details: Each sprinkle is a sphere, with
num_sprinklesnumber of sprinkles on the donut. The sprinkles are only on the top of the donut. The colour and position of each sprinkle is chosen at random.
- File(s):
Sprinkling:
- File(s):
sprinkled_donut.cpp - Details: This is the physics animation of the sprinkles getting “sprinkled” onto the donut. It falls at a velocity based on gravity and stops when it hits the surface on top of the donut.
- File(s):
Acknowledgements
https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSnXDGy2nwBLL2Is7rIqVDQkR6chGN1zNbDkg&s