Тёмный

Coding Challenge #25: Spherical Geometry 

The Coding Train
Подписаться 1,7 млн
Просмотров 171 тыс.
50% 1

Опубликовано:

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 170   
@MCRAVENATOR2222
@MCRAVENATOR2222 7 лет назад
the happiest coder ever, gotta love when a person is passionate about their field of expertise
@ElBellacko1
@ElBellacko1 3 года назад
i can see why he is a happy coder and it is because he is not stuck coding crud, business applications like many coders. he codes the fun stuff.
@blucenere
@blucenere 3 года назад
He is the happiest because is coding alone :)
@phuanhuynh8888
@phuanhuynh8888 2 года назад
Dr Livesey but he do programming
@ReevansElectro
@ReevansElectro 7 лет назад
The "Bob Ross" of programming! Not annoying at all.
@ReevansElectro
@ReevansElectro 3 года назад
@Chere Mizwicki And you're proud of that kind of hacking behavior?
@TristanPopken
@TristanPopken 3 года назад
@@ReevansElectro Dont worry, both of the comments above you were from bots. Nobody is being hacked
@alebonita09
@alebonita09 6 лет назад
This is the very best explanation I've seen about ANYTHING related to coding, and I'm finishing a 5 year major. You're awesome.
@tincuptan
@tincuptan 4 года назад
Seriously he is so good at coding, can you believe he is actually an arts major.
@rszec
@rszec 7 лет назад
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!!!!
@pietrononame4945
@pietrononame4945 2 года назад
Theres no map() function in Java.
@prestonhall5171
@prestonhall5171 6 лет назад
At the “epilogue” when he switched the sphere detail value to 5, it kind of looked like an object straight out of katamari (a Japanese game about rolling up things to create stars). The only difference is the color and texture. This is also made me realize just how important this code is for 3D games! Definitely saving this video.
@rubensolorio7390
@rubensolorio7390 7 лет назад
2 months ago, best teacher on my list; currently, hasn't changed. Thank you Dan!! :)
@TheCodingTrain
@TheCodingTrain 7 лет назад
Thanks for the nice feedback!
@zbrolman
@zbrolman 2 года назад
I really like your videos. I personally use them for educational purposes in 3d math, because I struggle with understanding the equations from wikipedia, but with your explanations everything becomes more clear. Thank you!
@zbrolman
@zbrolman 2 года назад
Or maybe sometimes I should try to visualize the problem instead of hopping straight into the code :D
@murzikmurzik2453
@murzikmurzik2453 7 лет назад
Please, make a coding challenge on how to make a randomly generated terrain on a sphere using Perlin noise. Thanks!
@TheCodingTrain
@TheCodingTrain 7 лет назад
Oh, this is a great idea.
@vulpesaxis8494
@vulpesaxis8494 7 лет назад
it is basically the same thing but r is now a funcion that depends on phi and theta it can be a trigonometric function,perlin noise, whatever you want and instead of 20 lon and lat values can be as much as you want ...I would recommend to use a bounded function so it will have a "nice" shape instead of peaks all over the sphere if you work the maths you can make every shape you want even a planet earth...I mean if you want to make it "not random"
@glenneric1
@glenneric1 2 года назад
This wacky flailing arm inflatable tube man is the best teacher ever!!
@vincentcleaver1925
@vincentcleaver1925 6 лет назад
Between you and the Englishman, Javidx9, I have learned spherical geometry plus how to cook up some pseudo perlin noise, and I'm doing some low-res, low-poly, world-building
@crisiberny
@crisiberny 8 лет назад
This is really awesome! Is nice to see how all things (vector calculus with the spherical coordinates thing and programming) come together. Congratulations!
@TheCodingTrain
@TheCodingTrain 8 лет назад
thank you!
@kxsteve2061
@kxsteve2061 6 лет назад
Great challenge you've got here! Keep up doing it man!
@hillarymapondera4122
@hillarymapondera4122 3 года назад
This is why I now believe that programming is not a nerdy boring thing I wish I had a professor Like you in University.
@Paul-cv8nv
@Paul-cv8nv 2 года назад
This is nerdy even more that regular programming
@alejandrogarciasainzsours4226
@alejandrogarciasainzsours4226 5 лет назад
Lol 10:36 looks nutty buddies. PD: Your videos are seriously awesome! You are a hero to anyone who stumbles upon them because of your brilliance in applying concepts that many would struggle with if it wasn't for your masterful teaching and friendly demeanor. You have my everlasting gratitude.
@DavidRisnik
@DavidRisnik 8 лет назад
Very very good Daniel! every new tutorial I learn new techniques, congratulations on your work .You do well clear explanations and well-defined !
@TheCodingTrain
@TheCodingTrain 8 лет назад
I really appreciate it!
@kevnar
@kevnar 2 года назад
It would be neat to see the points of the sphere effected by the gravity of a moon in orbit around it, causing tides. Turn the points into particles that can be pulled this way and that by another object.
@peterburton9855
@peterburton9855 4 года назад
Excellent, thanks :-) Finally, an understandable explanation of how to do this. It was clear enough that I was able to implement this in python and Opengl quite quickly. Will take a look at more of your videos for more tips.
@panktishah3510
@panktishah3510 Год назад
Hello Peter, can you please share your python code
@carldanso6707
@carldanso6707 4 года назад
U are the best , u've really made me understand the concept of 3D
@Gutagi
@Gutagi 4 года назад
Can you make other spheres, such as icosphere, or the “golden ratio sphere” by Sebastian Lague?
@arfcommer15
@arfcommer15 6 лет назад
Simplest way to not confuse lat/long is longitude are LONG(itudnal) lines going all the way over the poles, while latitude are circles that change in size.
@TheCodingTrain
@TheCodingTrain 6 лет назад
Thank you!!
@kyle-bensnyders3147
@kyle-bensnyders3147 6 лет назад
Another way is to think of FATitude instead of latitude.
@arfcommer15
@arfcommer15 6 лет назад
Third way is to play dyslexic and see latitude as "altitude" with the equator being ground, and latitude is how 'high' you are on the sphere.
@XeXPiti
@XeXPiti 8 лет назад
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
@TheCodingTrain
@TheCodingTrain 8 лет назад
+XeXPiti thanks for the feedback!
@TheCodingTrain
@TheCodingTrain 8 лет назад
+XeXPiti thanks for the feedback!
@charbelsarkis3567
@charbelsarkis3567 6 лет назад
hilarious
@valtsuhw
@valtsuhw Год назад
Well done, apparently the spots (x,y,z) math works just as well with C++, got a nice (dense, hollow) sphere.
@rollingc2013
@rollingc2013 2 года назад
I have been coding nearly 10 years.. ended up in the boring world of basically data presentation. This is the type of coding I want to do
@jstro-hobbytech
@jstro-hobbytech 2 года назад
Hey man. You're a newish poster. What type of Java is he using and in which ide? I haven't written Java since 1999 when I had to take it and applets ran horribly. Haha. I've been digging 3d coding lately and evaluating different ways to visualize the data from the lidar, mems and other sensors for a little bot I'm building. I'm leaning towards unreal using cpp but it doesn't have to be that complicated for a hobby project. I don't like unity, directx is way too much time to build a framework just to render 1 pixel, vpython was too slow and opengl was OK but I'm like the only programmer in the world who doesn't know js haha. I do know cool and pascal however. I'm old...43 haha
@eugene8976
@eugene8976 4 года назад
I wish I could like this twice :P
@shanebenlolo3160
@shanebenlolo3160 10 месяцев назад
Could you make a video about how you'd map a globe texture over a sphere?
@Linuxdirk
@Linuxdirk 2 года назад
To prevent the error described around 10:43 I always "properly" name my iteration variables.
@MilanKarakas
@MilanKarakas 7 лет назад
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.
@TheCodingTrain
@TheCodingTrain 7 лет назад
+WildMania great idea!
@MilanKarakas
@MilanKarakas 7 лет назад
Thank you in advance. I subbed, and set notification. So, when you finish video - I (and others) will be notified. No rush, currently messing with radio communication, FFT optimization, and other similar things on Atmel chips. What a headache... :D
@Shockszzbyyous
@Shockszzbyyous 7 лет назад
FFT on atmel chips ... must be on the 32bit ones :D
@MilanKarakas
@MilanKarakas 7 лет назад
You mean for speed? Right? Or amount of data? Thanks.
@Shockszzbyyous
@Shockszzbyyous 7 лет назад
***** both, I am used to working only with the 8 bit ones, so my mind went to those, and I thought not really useful nor practical :D and later remembered there were 32bit ones too. just being a bit random :)
@oooSIDEooo
@oooSIDEooo 7 лет назад
HSb ranges from 0-360, 0-100, 0-100 that way you get more colors in your rainbow
@Khusyasy
@Khusyasy 2 года назад
man... i wanted to know about spherical geometry but got existential crisis
@Skans0513
@Skans0513 6 лет назад
I'm doing a school project with p5.js to create a 3d music visualizer and your tutorials are so helpful! Thank you!
@shridharmamidalaa2509
@shridharmamidalaa2509 8 лет назад
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.
@TheCodingTrain
@TheCodingTrain 8 лет назад
Yay, so glad to hear!
@Shockszzbyyous
@Shockszzbyyous 7 лет назад
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 :)
@jstro-hobbytech
@jstro-hobbytech 2 года назад
What ide are you using? In all my years of (trying...) coding I've never touched Java since writing applets over 20 years ago and hated how slow it ran on a pentium 3 350mhz. Haha
@luukvanoijen7082
@luukvanoijen7082 7 лет назад
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
@DomhnallP
@DomhnallP 7 лет назад
insidetheOS it's pretty good for simple games, they teach freshman in my university how to use processing and one of their assignments is to design a game, a friend of mine made a 3D version of snake really easily. It looks great! Obviously it's very limited but it's good for getting started
@christianfranticich1592
@christianfranticich1592 7 лет назад
They are probably using it to teach programming which is absolutely fine. Also, with processing you can load objects, you can play sounds and it obviously is OOP since it's Java. I'm not sure where you got your information from.
@DomhnallP
@DomhnallP 7 лет назад
***** like christian said, it's just used to teach them the concept of programming, gives them something interesting to learn how to program algorithmically. they move onto Java in semester 2 and then after first year they move onto other languages!
@er4795
@er4795 7 лет назад
insidetheOS everything you said processing lacks, it has
@KuKoVisuals
@KuKoVisuals 8 лет назад
Finally a good mathematical explanation. although in math theta goes from 0 to 2PI & phi from 0 to pi is math and programmers colliding ? :(
@TheCodingTrain
@TheCodingTrain 8 лет назад
Yes, I definitely made some errors here. I hope I corrected it with the code I posted, if not file a github issue!
@KuKoVisuals
@KuKoVisuals 8 лет назад
hehe Idk I was drinking when I said this :x
@techlearner2746
@techlearner2746 4 года назад
For how many years did it take for learning coding u r so expert in this field please tell me
@Tithib59
@Tithib59 5 лет назад
Nice video ! Do you think it is possible to create a shpere made of hexagons with processing ? ^^
@fouadalkhazraji7546
@fouadalkhazraji7546 Год назад
how to write the code in java, especially the map instruction?
@manbirjudge8415
@manbirjudge8415 3 года назад
I was also going to type the comment that "Any idea how to fix it?". Haha. Love from India. : )
@benrex7775
@benrex7775 4 года назад
Watching the video at 3x speed. Your even more lively now.
@runhomie1013
@runhomie1013 7 лет назад
can you do a human body ?
@4444tttt
@4444tttt 2 года назад
hi, im trying processing 4.0 and its appears like variable ''total'' doestn exist, could anybody help me x.x
@prestonblumhagen8626
@prestonblumhagen8626 8 лет назад
Can you do a coding challenge on pong?
@thomasolson7447
@thomasolson7447 3 года назад
Mine is slow. Too slow for what I have planned. I made a second multidimensional array where I multiplied the lon and lat variables by n and do a sum. I put that sum into the fill in the second set of loops. fill(map(color[i][j],-((1/2)*sqrt(2)+1),(1/2)*sqrt(2)+1,0,255) ,255,255);. The sphere looks exactly how it should look. The problem is that it's too slow. Total has to go over 100 for the star pattern to look somewhat ok. Ideally it would go to 400+ to make it look smooth. I think I can do away with the color array. It would take more math to get the same result, but it's doable.
@philanglade2745
@philanglade2745 5 лет назад
3:30 Wrong : Earth is flat !!! So we need no spheres ! Great job, even if i'm late. Thank you very much!
@lightingavril4586
@lightingavril4586 3 года назад
Thank you so much!!!!!!!!
@vinayvyraveraja7102
@vinayvyraveraja7102 8 лет назад
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 ?
@TheCodingTrain
@TheCodingTrain 8 лет назад
The "strip" makes triangles out a sequence of vertices, like so: 1) ABC 2) CDE 3) EFG, etc. So it uses 3 at a time and repeats the last one.
@stephensimpson7794
@stephensimpson7794 5 лет назад
@@TheCodingTrain it repeats the last two. ABC BCD CDE. you go from top left to bottom left to top right for one triangle. then to bottom right of the second triangle to form a rectangle
@lolerskates876
@lolerskates876 4 года назад
Latitude :: Flat-itude
@ili76767
@ili76767 5 лет назад
I would like to ask you, PVector [] [] globe; How should the code be written in p5.js?
@deadmusik9969
@deadmusik9969 3 года назад
you could of kept going on the rabbit hole of simulation dan!
@poojavaghasiya7701
@poojavaghasiya7701 3 года назад
Nice coding..... Sir can you help me to arrange 25mm circle at equal distance on the surface of 13'9" Diameter sphere.
@gazzaka
@gazzaka 7 лет назад
I have often tried to code a geodesic sphere, any help? Also, a"wormhole" effect....
@milanlora
@milanlora 5 лет назад
How do you know what algorithm to use?
@eduugr
@eduugr 6 лет назад
Thanks for another amazing video!! I always wanted to learn howto code the camera by myself. I conceptually understand projection and transformation matrices. Can you people point me out some good reading, videos or a keyword to search more eficiently? Thanks in advance!!
@TheCodingTrain
@TheCodingTrain 6 лет назад
Would you mind asking at discourse.processing.org/! It's a better platform for Processing and p5.js related code questions. You can share code there easily! Feel free to link from here to your post.
@ericvega9160
@ericvega9160 4 года назад
drive.google.com/file/d/10PlTPYYMlaS2EnkXZJi2WwnqOfbyCgXn/view?usp=drivesdk please!! Help me, i want to draw all faces properlly, thank you
@angelcaru
@angelcaru 5 лет назад
2:56 Flat earthers disliked
@yakov9ify
@yakov9ify 8 лет назад
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
@yakov9ify
@yakov9ify 8 лет назад
never mind you adresed it
@eduzal
@eduzal 7 лет назад
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
@Master-qr3eq
@Master-qr3eq 4 года назад
i want to download your code of this video? is it possible sir and where from i download it? Anyone can help me
@adamstybrzynski3216
@adamstybrzynski3216 4 года назад
Hey there! You are doing excellent thing here...tons of appreciation! Does anybody have an idea how can I make the rainbowish ball at the end transparent? I am trying with tint(); function however with no result...
@Chloehjk
@Chloehjk 8 лет назад
Thanks a lot for coding challenge~ awesome. in the video you take three sentence at the same time and add //
@TheCodingTrain
@TheCodingTrain 8 лет назад
CMD-/ is the shortcut!
@lucianopazona9976
@lucianopazona9976 7 лет назад
Genio
6 лет назад
Luciano Paz Oña es un idolo
@ophello
@ophello 6 лет назад
Can anyone tell me how to make a 3D geodesic sphere in p5?
@rakeshnatkarp-2965
@rakeshnatkarp-2965 8 лет назад
its good
@thesdfable
@thesdfable 3 года назад
hello! first of all thank you you are an amazing teacher. I get this error " ArrayIndexOutOfBoundsException: 60" I don't really understand why. Is it because my index is outside the range, smaller than the length of the array?
@thesdfable
@thesdfable 3 года назад
Yup sorry my mistake! figured it out!
@iansimpson9452
@iansimpson9452 7 лет назад
is it possible to add a 4th dimension?
@iansimpson9452
@iansimpson9452 7 лет назад
in a testing way?
@sCube369
@sCube369 7 лет назад
Ian Simpson it would completely depend on your logic, practical and/or visual definition of 4th dimension, but as soon as you figure with aproach you want, you'd have to start from there on how to program it. Long story short it's up to what you define as dimension in order to do it.
@connorclub6244
@connorclub6244 2 года назад
the moment i started the video and saw that i audibly said "what the fu-"
@happyeverafter1797
@happyeverafter1797 Год назад
Lazy Latitude Lays Down :)
@realcygnus
@realcygnus 7 лет назад
priceless
@marcogaruffo
@marcogaruffo 11 месяцев назад
Θ lat. And φ long
@vickyjha8071
@vickyjha8071 4 года назад
I want the code in proper format. Please provide me.
@adammeier6477
@adammeier6477 6 лет назад
I sat through the video for about 20 min waiting to see if you acknowledged that you mixed up the inclination and the azimuth, haha
@钩不到人怎么办
@钩不到人怎么办 6 лет назад
It took me some time to figure out why he mixed up spherical coordinate system but still got a sphere.
@DemetrisLeptos
@DemetrisLeptos 7 лет назад
please create app so that I can auto-like all your videos..
@danielpashai7111
@danielpashai7111 8 лет назад
post the code
@KeenanWoodall
@KeenanWoodall 7 лет назад
"One noted that in the UK “phi” was always pronounced to rhyme with “pie” but that some Americans at conferences pronounced it “fee”. Another noted that in Greek the letter PHI is indeed pronounced PHEE. However, in Greek the letter we call PI is also pronounced PEE." I'm just gonna pronounce it FEE otherwise I'll have to start pronouncing pi as PEE, haha.
@mlutteral
@mlutteral 5 лет назад
Ceci n'est pas une sphère
@MatthewHolevinski
@MatthewHolevinski 7 лет назад
povray did it better
@ABaumstumpf
@ABaumstumpf 7 лет назад
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.
@GeorgeZaharia
@GeorgeZaharia 3 года назад
10:00 11:20 exactly what i needed to wrap a image around a "3d sphere" in logical sense of things thank you my guy... now lets turn the lights off for those Russians by trowing javascript 2d/3d spheres at them lol .... kidding i love russians suka ^_^
@theobgshow
@theobgshow 3 года назад
"Foldy, patterny thing". Haha.
@venkateshwaran292
@venkateshwaran292 Год назад
Quick question, how do we print a 2D line? A line consists of infinite points. Do we interpolate all the pixels between two distinct co-ordinates? How do we actually plot a continuous line with discrete points?
@admin1b12
@admin1b12 4 года назад
you are the best youtuber in the world YOU HAVE ONLY 30 DISLIKES IN 2020
@deadmusik9969
@deadmusik9969 3 года назад
I got to the point of using my i and j variables and it says they cannot be resolved into a variable. declared them uptop,then i ran into the cam as not a variable damn
@henriquetuerpe8300
@henriquetuerpe8300 3 года назад
what the function map develops there? in c++ we don't have that
@practicodelaconspiracion
@practicodelaconspiracion Год назад
those monigotes are really necessary?
@boscorner
@boscorner 2 года назад
You're really strange. I love it. :D
@boonewalker3973
@boonewalker3973 2 года назад
Existential crisis incoming
@oreostastegoods
@oreostastegoods 8 лет назад
Do some icospheres!
@MarshallThomas
@MarshallThomas 4 года назад
can you do this in P5.
@theobgshow
@theobgshow 3 года назад
Such an amazing and informative presentation. Thank you.
@cliffspencer
@cliffspencer 3 года назад
Watching these videos, I always wonder why more expressive variable names aren't used. Instead of saying "okay, let's make j represent longitude", why not just name the variable longitude?
@fiveoneecho
@fiveoneecho 5 лет назад
Pretty sure it's pronounced Ph[eye], since the other letters have long 'i's, but I'm not certain.
@YdenPL
@YdenPL 7 лет назад
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.
@matthewe.proteau6100
@matthewe.proteau6100 2 года назад
Love the tutorial thanks Dan! DOes anyone know how to get and affect a single point in this shape? I just want to take a single point and move it inwards towards the center of the circle
@WildAnimalChannel
@WildAnimalChannel 7 лет назад
always with the rainbows!
@Person47
@Person47 6 лет назад
what if you sont have peasycam
@arfcommer15
@arfcommer15 6 лет назад
Go to tools | add tools, then pick library tab, and pick PeasyCam from the list and pick install, there's a bunch of other stuff to add too, they have examples for usage.
@c7ndk
@c7ndk 6 лет назад
Great video. But minor error; you swapped longitude and lattitude :p
@xoOoBunnyoOox
@xoOoBunnyoOox 3 года назад
wow from a sphere to "what's the reason in life?" real quick
@ericvega9160
@ericvega9160 4 года назад
how do you control the polar axis?
@mwint1982
@mwint1982 5 лет назад
Triple snaps for this guy
@frerosami7
@frerosami7 7 лет назад
thank you very much you help me so much!!!!!
Далее
Coding Challenge #26: 3D Supershapes
21:35
Просмотров 87 тыс.
Coding Challenge #90: Floyd-Steinberg Dithering
28:51
Просмотров 437 тыс.
Китайка и Максим Крипер😂😆
00:21
We finally APPROVED @ZachChoi
00:31
Просмотров 7 млн
Coding Adventure: Procedural Moons and Planets
22:48
Просмотров 1,7 млн
Researchers thought this was a bug (Borwein integrals)
17:26
Coding Challenge 93: Double Pendulum
31:11
Просмотров 919 тыс.
AI can't cross this line and we don't know why.
24:07
Просмотров 850 тыс.
Coding Adventure: Portals
16:06
Просмотров 1,3 млн
What was Coding like 40 years ago?
29:05
Просмотров 1,7 млн
All OpenGL Effects!
30:21
Просмотров 63 тыс.
Китайка и Максим Крипер😂😆
00:21