Coding Challenge #25: Spherical Geometry

[ad_1]
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.

Support this channel on Patreon:

Send me your questions and coding challenges!

Contact:

Links discussed in this video:
Video on Polar Coordinates:
Paul Bourke’s Supershapes (Superformula) website:
Reza Ali’s 3D Supershapes:
Wikipedia’s Spherical Coordinates System:
peasycam website:

Source Code for the Video Lessons:

p5.js:
Processing:

For More Supershape videos:

For More Coding Challenges:

Help us caption & translate this video!


Posted

in

by

Tags:

Comments

40 responses to “Coding Challenge #25: Spherical Geometry”

  1. Bradley Stone Avatar

    These videos are 80% code, 20% stream of conscience, 40% rainbows, and 141% awesome 😀

    Question…I just realized you're now coding in Java, or are you? At what point did you start doing that? I'm coming from the Javascript and "working with data" playlists, and a friend of mine has put me to the task of building something similar to this video. So uhh, this whole thing doesn't work in Javascript/ P5.js, right?

  2. Demetris Leptos Avatar

    please create app so that I can auto-like all your videos..

  3. Mike Delmonaco Avatar

    1:30 yeah just throw in a quick existential crisis

  4. Edu Zal Avatar

    hi. i'm having issues with peasycam and processing 2.2.1. It gives a jave error.
    java.lang.UnsupportedClassVersionError: peasy/PeasyCam : Unsupported major.minor version 52.0

  5. Ruben Solorio Avatar

    2 months ago, best teacher on my list; currently, hasn't changed. Thank you Dan!! 🙂

  6. Khalid Khattak Avatar

    God bless you..keep smiling..

  7. Julian Not a Name Avatar

    HSb ranges from 0-360, 0-100, 0-100 that way you get more colors in your rainbow

  8. dadziokPL Avatar

    Maybe people pronounce "fi" this way, because they pronounce "pi" the same way, and it's also a greek letter. Just my little theory here.

  9. frero sami Avatar

    thank you very much you help me so much!!!!!

  10. murzik murzik Avatar

    Please, make a coding challenge on how to make a randomly generated terrain on a sphere using Perlin noise. Thanks!

  11. AZFrank Castle Avatar

    can you do a human body ?

  12. Robert Evans Avatar

    The "Bob Ross" of programming! Not annoying at all.

  13. gazzaka Avatar

    I have often tried to code a geodesic sphere, any help? Also, a"wormhole" effect….

  14. Shockszzbyyous Avatar

    The more of your video's I watch the more clear things I've coded in the past become. which is kind of weird, but makes sense since there is a lot of thing I coded that I didn't really understand 🙂

  15. ABaumstumpf Avatar

    I like how to make everything easier to code you ignore the corner-cases all the time XD

    At the top and bottom of the sphere you have a punch of points all in the exact same spot.
    That also makes that you have an alternating pattern of a normal triangle and a triangle where 2 verticies are at the same spot.
    And because you flipped the way the strips are created, you also flipped some triangles around so that the back-face is showing.
    Those 2 together make for some strange patterns at the poles.

    And another thing:
    because you do not connect the triangle-strips back to the start but create new points at the same location the deformation you apply rip the sphere apart – as the start and end-point, while originally at the same position, are not the same points and get a different random deflection.

  16. dopefish86 Avatar

    thank you! your videos often help me out when i have no idea how to code certain things! like this one!
    i would actually need a ICOSPHERE — where all the triangles are of the same size.

    maybe you could do a video on how to achieve that also, some time! — but for now i'll have to figure it out myself 😉

    https://en.wikipedia.org/wiki/Icosphere
    https://en.wikipedia.org/wiki/Regular_icosahedron
    Probably my solution is somewhere in here: https://threejsdoc.appspot.com/doc/three.js/src.source/extras/geometries/IcosahedronGeometry.js.html

  17. Ian Simpson Avatar

    is it possible to add a 4th dimension?

  18. WildMania Avatar

    Excellent presentation. Do you have already done video about mapping pixels onto globe? I mean, some image – then render it over the globe, or part of the globe. I think this will be very usable to have. Thanks.

  19. OJ GOD- Hajime Hinata Avatar

    the happiest coder ever, gotta love when a person is passionate about their field of expertise

  20. Rommel Sánchez Avatar

    Awesome! Until now, I learned about topography, botanics, algebra, hydromechanic, and a lot of other subject just by watching you programming in Java… All of that without getting tired or bored!
    Thanks a lot!!!!

  21. mathIsART Avatar

    "It's really easy to create a sphere. […] The sphere isn't actually a sphere. […] Maybe everything we are is some kind of weird computer simulation". That escalated quickly.

  22. Luuk van Oijen Avatar

    Could this code be compiled to a .exe? This seem like a very nice tool and language to make games with. Currently learning Love2D but it's pretty hard to get 3D to work, and I couldnt get Love3D to work

  23. demian triebl Avatar

    i need to create and rotate a poliedric like dice 20 faces. do you knows?

  24. KuKo Visuals Avatar

    Finally a good mathematical explanation. although in math theta goes from 0 to 2PI
    & phi from 0 to pi is math and programmers colliding ? 🙁

  25. Vinay Vyraveraja Avatar

    Hey Daniel, in the Processing reference website I realize at least three vertices are need to construct a triangle strip, however you only use two vertices in your code to construct full strip. How this is possible ?

  26. Sixten Hugosson Avatar

    lights camera action… wait did you play undertale

  27. chloe kim Avatar

    Thanks a lot for coding challenge~ awesome.
    in the video you take three sentence at the same time and add // <– this value quickly. is there and shorcut? and also how to get rid of quick like you?

  28. Cristian Bernal Avatar

    This is really awesome! Is nice to see how all things (vector calculus with the spherical coordinates thing and programming) come together. Congratulations!

  29. XeXPiti Avatar

    I´m at my third year studying computer science and also work as an visual artist at partys, and you´r teaching me everything i wanted to learn about this stuff i ever wanted. do you even now how much of your work is needed in this business?
    (PS: i know, fuck my english / and yes im drunk at this moment ^^)

    best regards from austria <– the guy without the kangaroos

  30. David Risnik Avatar

    Very very good Daniel! every new tutorial I learn new techniques, congratulations on your work .You do well clear explanations and well-defined !

  31. Yakov Reznikov Avatar

    you confused londitude and latitude in the x,y,z calculation z is supposed to only be cofntrolled by latitude bu in your equetion it is controlled by longitude

  32. Tanner Fox Avatar

    Can you do a coding challenge on pong?

  33. Shridhar Mamidalaa Avatar

    Thank you so much Daniel Shiffman . !!! I started exploring "backstage" technologies… on how meshes are formed in 3D softwares , Marching cubes and so on….. This video was real helpful.

  34. Franklin Hunt Avatar

    First!
    I Liked the video, cant wait for more 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *