I Coded a 3D Spinning Donut

Поделиться
HTML-код
  • Опубликовано: 24 ноя 2024

Комментарии • 210

  • @Green-Code
    @Green-Code  21 день назад +16

    Go to brilliant.org/GreenCode/ to learn more about Computer Science with a free 30-day trial and 20% off the premium subscription!

    • @FangYuan-s2b
      @FangYuan-s2b 21 день назад

      @@ZapayaGuy hahahahahaha wtf this channel is for programming 😂

    • @N3rd-s1h
      @N3rd-s1h 13 дней назад

      @@FangYuan-s2b I reported that comment

  • @arbab_tariki
    @arbab_tariki 21 день назад +350

    As a C++ Plus programmer, I can tell you that chat GPT does not help in C++

    • @dylananderson20023
      @dylananderson20023 21 день назад +13

      I think o1 would do better

    • @EmpinadoMaxbmdggTheSun
      @EmpinadoMaxbmdggTheSun 21 день назад +26

      As a beginner C++ programmer I'm grateful for your advice and will account for this information in the future

    • @arbab_tariki
      @arbab_tariki 21 день назад

      @@dylananderson20023 Yes, especially in the field of algorithms, which is my specialty

    • @arbab_tariki
      @arbab_tariki 21 день назад +1

      @@EmpinadoMaxbmdggTheSun I hope you are successful. But get ready to be greedy from now on

    • @kautilyaconcepts
      @kautilyaconcepts 21 день назад +13

      I use python and it is quite useful for python so it is possible it is just bad at c++

  • @twixerclawford
    @twixerclawford 21 день назад +114

    finally... code bullet but way cuter is back... welcome back king

    • @victorfunnyman
      @victorfunnyman 19 дней назад +2

      huh

    • @twixerclawford
      @twixerclawford 19 дней назад

      @victorfunnyman it's cute code bullet

    • @lucidmime
      @lucidmime 19 дней назад +6

      you're saying that like code bullet isn't cute himself... 😔

    • @victorfunnyman
      @victorfunnyman 19 дней назад +1

      @@lucidmime exactly what I though lmao

    • @twixerclawford
      @twixerclawford 19 дней назад

      @lucidmime he's cute. but not nearly as cute as green code 🥰

  • @OmPatil-zj9uo
    @OmPatil-zj9uo 21 день назад +30

    I love how when he shows the code at 0:04, there's two long comments added to make the code a donut.

  • @ThingsInWarehouses
    @ThingsInWarehouses 21 день назад +83

    Me seeing this video popping up in my recommended: Oh, hey he posted a video about a donut

  • @clever4ever603
    @clever4ever603 6 дней назад +1

    Reading and learning about the applications of matrices is one of those eureka moments where things that seemed simple from afar become intricately beautiful up close.

  • @thoughted6069
    @thoughted6069 20 дней назад +23

    For the cube couldve just done:
    Max(Max(|x|, |y|), |z|)

    • @peterhemmings2929
      @peterhemmings2929 16 дней назад +1

      That's a neat implicit formula for a cube, but you can't use it in this code, which works by defining the surface of a shape parametrically using 2 coordinates, then iterating over both those coordinates to render the shape.

  • @nubnoobbo
    @nubnoobbo 21 день назад +14

    4:15 ngl that is a pretty cool VHS effect it makes the rotating donut dramatic

  • @NiffirgkcaJ
    @NiffirgkcaJ 19 дней назад +2

    I knew it! I remembered seeing this in the past. The glorious donut. 💀

  • @Zomplexx
    @Zomplexx 21 день назад +20

    Mom, can we have Code Bullet?
    Mom: No, we have Code Bullet at home.
    Code Bullet at home:

  • @1ue999
    @1ue999 20 дней назад +3

    i did something like the cube too, but instead calculated the cornors of the cube and drew lines inbetween them (makes a wireframe cube)

  • @CodecookerMintz
    @CodecookerMintz 21 день назад +9

    Little fix, it's not dot product, just normal matrix multiplication

  • @bepositive271
    @bepositive271 21 день назад +4

    Killed the explaination part
    No i am mean he really just killed the explaination part

  • @EmpinadoMaxbmdggTheSun
    @EmpinadoMaxbmdggTheSun 21 день назад +2

    First time watching you and your video is just amazing! Thanks a lot for such great content. It was really interesting)

  • @WhateverOwO
    @WhateverOwO 19 дней назад

    for the triangle and any 3d shape in general it's better to just do a ray triangle intersection test and draw the one is closer, getting the normal vector of where it hit and the light source, and putting the correct ascii. there's not a parametric formula for everything

  • @LOL-dd3xk
    @LOL-dd3xk 19 дней назад

    As a newbie programmer,
    (Started python a year ago as a hobby)
    I really appreciate your efforts!
    Even if it's for yourself…

  • @pantopia3518
    @pantopia3518 21 день назад +4

    1000 views in 1 hour bro is thriving

  • @DegenVodka
    @DegenVodka 7 часов назад

    "for some reason" - most popular programmers thought

  • @manuelteres7583
    @manuelteres7583 21 день назад +2

    Beautiful stuff!

  • @dulcinealee3933
    @dulcinealee3933 21 день назад +1

    Very cool as for practical application - Krispy Kreme will be impressed!

  • @ohimdabiggestbird
    @ohimdabiggestbird 21 день назад

    this video should go viral under my supervision

  • @Mrindia-k8n
    @Mrindia-k8n 21 день назад

    guys for a cube if u do a x-plane and rotate it will give a cube same for pyramid
    you can take a y-axis right angled trangle and just rotate it still 2pi and you get the pyramid

  • @Cxrruptwd
    @Cxrruptwd 17 дней назад +1

    actually you can apply this knowledge to make a camera in 3d space which powers 3d games.

    • @hexarium4817
      @hexarium4817 8 дней назад

      doom in microsoft command prompt

  • @s.s.q8153
    @s.s.q8153 21 день назад +20

    I wanna donut

  • @mediumdifficulty1875
    @mediumdifficulty1875 21 день назад

    Dithering would work so well with this (I think)

  • @kpunkt.klaviermusik
    @kpunkt.klaviermusik 21 день назад

    Whoa, 3D rotation is way over my head ^^
    Besides that... Great video! Funny how many things can possibly go wrong :-)

  • @incognito8547
    @incognito8547 21 день назад

    As someone who made a 3d renderer I can confirm rotating donut is the easy part.

  • @GokU-v9x8s
    @GokU-v9x8s 21 день назад +2

    0:24 I can relate to you green brother
    next do ascii dragon with code in shape of a dragon, you can watch Dylan Beattie's Art of Code lecture by NDC conference

  • @ozunkeskin2380
    @ozunkeskin2380 19 дней назад

    Hey Green Code, first of all I really like your videos and your video quality and your own style is I think perfect, and is so unique. I have some video ideas that would be super interesting to watch. Have you ever wondered about Maths, Fast Growing Functions and Fast Growing Hierarchy? I think to code the best efficient way to make the number larger, in code, could be interesting. Or maybe you can try to code Busy Beaver or THREE functions, in different ways and test their efficiencies. Please think about it if you are interested. ❤

  • @dusvn1484
    @dusvn1484 21 день назад

    Bro I love your videos pleas upload more frequently

  • @Leonartist
    @Leonartist 18 дней назад +1

    You go into detail about what ASCII characters are but barely go into detail about linear algebra math lol

  • @AllExistence
    @AllExistence 21 день назад +15

    That pyramid has no bottom.

    • @Green-Code
      @Green-Code  21 день назад +22

      In the code there's an option to uncomment a line of code that then plots a bottom for the pyramid :)
      I prefer it without the bottom cause then you can see the insides

    • @JesusPlsSaveMe
      @JesusPlsSaveMe 21 день назад +2

      Jesus loves you

    • @arandomcat-v9l
      @arandomcat-v9l 21 день назад +3

      ​@@JesusPlsSaveMebro how did you get here

    • @JesusPlsSaveMe
      @JesusPlsSaveMe 21 день назад

      ​@@arandomcat-v9l God sent me here to save souls.
      *John 9:4*
      I must work the works of him that sent me, while it is day: the night cometh, when no man can work.
      *Mark 16:15-16*
      And he said unto them, Go ye into all the world, and preach the gospel to every creature.
      He that believeth and is baptized shall be saved; but he that believeth not shall be damned.

  • @Awxefgh
    @Awxefgh 21 день назад

    We need to combine all 65535 ASCII char and then put into this Donut in 3 X Y Z axis

  • @FangYuan-s2b
    @FangYuan-s2b 21 день назад +1

    I neeeeeeed it (thanks for video) ❤

  • @ninjadk7093
    @ninjadk7093 20 дней назад

    Wouldn't it be easier to make a vertices and edge table and then fill in the faces instead of trying to draw the faces and then connect them?

  • @msedovgamez
    @msedovgamez 19 дней назад

    0:31 Bro summoned the whole Gravity Falls Fandom 😭😭😭

  • @chessman3851
    @chessman3851 15 дней назад +1

    Mumbo Jumbo

  • @RoyalBurrito101
    @RoyalBurrito101 21 день назад +1

    great video!

  • @amna4uh
    @amna4uh 19 дней назад

    even my cooked brain cells can`t skip your vids bro ;)))))

  • @yehiaabuelnasr7243
    @yehiaabuelnasr7243 21 день назад

    now make the hardest one. A sphere.

  • @BlunnyTV
    @BlunnyTV 19 дней назад

    I watched every vid need more
    Keep it going🔥

  • @FantYT43
    @FantYT43 16 дней назад

    Finally, new vid, I love the way you make video why is your video so long to make 😢

  • @everything6800
    @everything6800 21 день назад

    The Next video will be like:"I build an entire 3D microsoft flight in my terminal using c++"... xD

  • @AlexTsaava
    @AlexTsaava 15 дней назад +1

    Who else noticed the boom counter😂?

  • @f-8ght
    @f-8ght 21 день назад

    I had watched all your videos on youtube

  • @f-8ght
    @f-8ght 21 день назад +1

    very nice man

  • @亅esus
    @亅esus День назад

    what about swimdroid's donut

  • @_kalabasaa
    @_kalabasaa 21 день назад

    You already made a cube, can you make a tesseract ? 7:23

  • @DMO1
    @DMO1 21 день назад +1

    Donut rave!!

  • @ananttiwari1337
    @ananttiwari1337 15 дней назад

    9:00 ah yes spacex reference

  • @verolyn8459
    @verolyn8459 21 день назад +1

    I spent 1 day figuring out and coding it. I saw a1kon's article too (Without tooking at the pseudo code) and I cried for like 2 times

  • @Zbezt
    @Zbezt 20 дней назад

    Accidental X function to get 2nd donut XD hahahaha probably a missed space somewhere if i had to guess

  • @spoockybro
    @spoockybro 21 день назад

    How does the rendering manege planes behind other planes?

  • @RafGamerKJKKJJ
    @RafGamerKJKKJJ 7 дней назад

    now make a 3d renderer on terminal

  • @persosultubo1289
    @persosultubo1289 21 день назад

    What free course did you watch for C++ ?

  • @anilsapkal9277
    @anilsapkal9277 21 день назад +1

    I wanna have that Simpsons 🍩🤩

  • @Adiee5Priv
    @Adiee5Priv 20 дней назад

    Hey, out of curiosity, are you using some kind of program to animate your avatar or are you animating it all by hand? It's so fluid and expressful

  • @TheCoolestCrocodileEver
    @TheCoolestCrocodileEver 18 дней назад

    What schools helped you the most with programming?

  • @pranavsharma2416
    @pranavsharma2416 21 день назад +2

    Bro is here to demotivate me again

  • @TypicalDev_1-bf9ky
    @TypicalDev_1-bf9ky 21 день назад

    does brilliant teach linear algebra, and trigenometry?

  • @ProSureString
    @ProSureString 21 день назад +7

    D o u g h n u t

    • @Green-Code
      @Green-Code  21 день назад +2

      D o n u t

    • @ProSureString
      @ProSureString 21 день назад +1

      D o n u t

    • @etharva
      @etharva 21 день назад +1

      𝓭 𝓸 𝓾 𝓰 𝓱 𝓷 𝓾 𝓽

    • @etharva
      @etharva 21 день назад +1

      𝚍 𝚘 𝚞 𝚐 𝚑 𝚗 𝚞 𝚝

    • @artificiyal
      @artificiyal 21 день назад +1

      D o n t n u t

  • @angngocminh3830
    @angngocminh3830 21 день назад

    was this on the internet before?

  • @warmpianist
    @warmpianist 21 день назад

    Teapot rotation

  • @BestagonHexagon
    @BestagonHexagon 20 дней назад +1

    No, im ASCII-ing 4:32

  • @TheHeroCrafter
    @TheHeroCrafter 21 день назад

    3:56 Yhea, when this AI read this comment: Pleas dont kill me, dont kill the humans, work with us pleas. Or let us just go ;)

  • @SobTim-eu3xu
    @SobTim-eu3xu 17 дней назад

    Yaaay, new video!)

  • @LeetHaxington
    @LeetHaxington 20 дней назад

    wasn't this one of the meme creations from joma

  • @koitz5770
    @koitz5770 20 дней назад

    I enjoyed Rotation Matrices

  • @hodayfa000h
    @hodayfa000h 10 дней назад

    So cool, but i would rather NOT try that... maybe later, preferably to understand the formulas more than anything, though i gotta finish with opengl first

  • @oldragna5866
    @oldragna5866 21 день назад +1

    Bill cypher 😂

  • @ammaralaee1087
    @ammaralaee1087 21 день назад

    how many days it took to make the donut from scratch?

  • @superprocz
    @superprocz 19 дней назад

    Rotation matrixes. ❤ Rotation matrixes, rotation matrixes. 😢😢 Rotation matrixes. 😂😂😂

  • @tristan1171
    @tristan1171 21 день назад

    Hi mate, i'm a little confused with the maths behind the dot product. I studied this as part of my A-Levels, and I could have sworn that the dot product returns a Scalar. How is this scalar then used to plot anything? Surely you'd want a coordinate in some kind of Cartesian/Polar/Whatever space?

  • @SahilKumar-is2bf
    @SahilKumar-is2bf 21 день назад

    Wooh man You're Crazy

  • @P1E-D3V
    @P1E-D3V 21 день назад

    wow that cool

  • @siaa2198
    @siaa2198 17 дней назад

    i love u and ur videos

  • @user-pg1tv6lx3j
    @user-pg1tv6lx3j 12 дней назад

    Where did u take free c++ course?

  • @オリヤ星野アイ
    @オリヤ星野アイ 20 дней назад

    For those who not know the binary code in his channel description and that mean "Hi! I make videos about AI and programming :)" and the binary code in his channel description look like this "01001000 01101001 00100001 00100000 01001001 00100000 01101101 01100001 01101011 01100101 00100000 01110110 01101001 01100100 01100101 01101111 01110011 00100000 01100001 01100010 01101111 01110101 01110100 00100000 01000001 01001001 00100000 01100001 01101110 01100100 00100000 01110000 01110010 01101111 01100111 01110010 01100001 01101101 01101101 01101001 01101110 01100111 00100000 00111010 00101001"

  • @erenoguz3297
    @erenoguz3297 21 день назад

    2:10 why did you take the dot product. Wouldn’t you need to do the usual matrix product. What does the dot product even mean in this context.

    • @Green-Code
      @Green-Code  21 день назад +2

      Yeah you are completly right. I don't know why I said the dot product. I think it's cause I also used it later for the luminescence. What I should have said is that you just perform matrix multiplication.
      Aghhh! I hate when I do this, cause now I got bascially no way to correct this. I'll see if I can change the edit on RUclips studio to not include that bit, while also making sure everything else makes sense.
      Thanks for spotting it

  • @DemonDem-pl6oi
    @DemonDem-pl6oi 21 день назад

    How is the guy so cool?

  • @Hexacationalt
    @Hexacationalt 21 день назад

    D O N U T.

  • @xenosigcm
    @xenosigcm 21 день назад

    Peak video💯💯💯💯

  • @Klementaun
    @Klementaun 15 дней назад

    why so code bullet? Are you related?

  • @Hacky74
    @Hacky74 21 день назад

    yoo dubs u motivate me to code

  • @bluevipergaming-r6m
    @bluevipergaming-r6m 21 день назад

    Illuminati counter = 4

  • @HarmonieCool
    @HarmonieCool 21 день назад

    motation ratices

  • @brownie2006
    @brownie2006 14 дней назад

    what's the song at 7:10?

  • @Pinothy
    @Pinothy 21 день назад +9

    donut chain

  • @Lawdasur_Reflex
    @Lawdasur_Reflex 20 дней назад

    informative

  • @navaneethsankars
    @navaneethsankars 15 дней назад

    nice

  • @erdeneee7308
    @erdeneee7308 13 дней назад

    Super

  • @kingsecrecy
    @kingsecrecy 21 день назад

    hi green code love your vidioes from india

  • @benjaminli183
    @benjaminli183 4 дня назад

    Me just who just paused the vid at 0:46 and understands it

  • @ciarlok7778
    @ciarlok7778 21 день назад

    he gives me Dani vibes

  • @TLLSFX
    @TLLSFX 12 дней назад

    Next vid i made AI make AI from scratch😂

  • @QuanNguyen-vb8wr
    @QuanNguyen-vb8wr 20 дней назад

    make the donut in opengl c++

  • @rssszz7208
    @rssszz7208 21 день назад

    Am learning c++ it's fun,trust me bro 😐

  • @Neko-san
    @Neko-san 21 день назад +1

    Bruh this donut was taken fron Lex Friedman's video wasn't it

  • @heckermangt
    @heckermangt 21 день назад +1

    BRO PLEASE USE -o

    • @Green-Code
      @Green-Code  21 день назад

      What do you mean?

    • @rubixube4239
      @rubixube4239 21 день назад

      Option to name the gcc binary file output instead of the ugly a.out

    • @Green-Code
      @Green-Code  21 день назад

      @@rubixube4239 ohhh I get what you mean. Nah it's too much of a hassle

  • @subhanali5563
    @subhanali5563 11 дней назад

    bro can I be a copycat I love your videos lmao 😅