Coding Challenge #25: Spherical Geometry
In this coding challenge, I create a sphere in Processing using spherical coordinates and triangle strips. This is the 3rd part of a multi-part series on superformulas, superellipses and supershapes. Code: https://thecodingtrain.com/challenges/25-spherical-geometry
đšī¸ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/qVs1hxtc
đĨ Previous video: https://youtu.be/BjoM9oKOAKY?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
đĨ Next video: https://youtu.be/akM4wMZIBWg?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
đĨ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
đ Supershapes (Superformula): http://paulbourke.net/geometry/supershape/
đĨ 3D Supershapes: http://www.syedrezaali.com/3d-supershapes/
đ Spherical Coordinates System on Wikipedia: https://en.wikipedia.org/wiki/Spherical_coordinate_system
đĨ Peasycam: http://mrfeinberg.com/peasycam/
Videos:
đĨ My Video on Polar Coordinates: https://youtu.be/O5wjXoFrau4
đĨ Supershape track: https://thecodingtrain.com/tracks/supershapes
đ´ Livestream Archive: https://youtu.be/m8WhMeW8jj0
Related Coding Challenges:
đ #19 Superellipse: https://youtu.be/z86cx2A4_3E
đ #23 2D Supershapes: https://youtu.be/ksRoh-10lak
đ #26 3D Supershapes: https://youtu.be/akM4wMZIBWg
đ #112 3D Rendering with Rotation and Projection: https://youtu.be/p4Iz0XJY-Qk
Timestamps:
0:00 Introduction to the Coding Challenge
0:43 The 3D Processing primitive sphere()
1:48 Triangle strips
2:55 Latitude and longitude
4:11 Angle of rotation
5:53 The resolution of the sphere
7:20 Map the latitude and longitude to the points on the sphere
11:33 Add a PeasyCam object
13:28 Meshing the sphere
14:53 Add a 2D array to store the vertices
17:28 Add triangle strips
19:57 Adjust code to fix the gaps
21:00 Alternate colors to add strips
22:19 Add HSB mode to add rainbow colors
23:37 Add some randomness to animate a "jiggling" sphere
24:55 Bonus addendum: updated rainbow bands
26:30 Thanks for watching!
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
đ Website: http://thecodingtrain.com/
đž Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
đŠ Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
đĄ GitHub: https://github.com/CodingTrain
đŦ Discord: https://discord.gg/hPuGy2g
đ Membership: http://youtube.com/thecodingtrain/join
đ Store: https://standard.tv/codingtrain
đī¸ Twitter: https://twitter.com/thecodingtrain
đ¸ Instagram: https://www.instagram.com/the.coding.train/
đĨ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
đĨ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
đ p5.js: https://p5js.org
đ p5.js Web Editor: https://editor.p5js.org/
đ Processing: https://processing.org
đ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct
This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new
#3dsupershape #sphericalgeometry #polarcoordinates #trianglestrips #3d #processing