Coding Challenge #25: Spherical Geometry

Subscribers:
1,750,000
Published on ● Video Link: https://www.youtube.com/watch?v=RkuBWEkBrZA



Duration: 26:35
163,204 views
2,815


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







Tags:
coding challenge
3d supershape
spherical geometry
education
mathematics (field of study)
spherical
tutorial
code
p5.js
processing
daniel shiffman
creative coding
processing tutorial
sphere
challenge
superformula
p3d
spherical coordinates
spherical system
coding
polar coordinates
reza ali
paul bourke
TRIANGLE_STRIP
triangle strips
processing beginShape
sphere geometry
3d
3D sphere tutorial
trigonometry