I Coded a 3D Spinning Donut

Поділитися
Вставка
  • Опубліковано 6 лис 2024

КОМЕНТАРІ • 168

  • @Green-Code
    @Green-Code  3 дні тому +11

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

    • @ZapayaGuy
      @ZapayaGuy 3 дні тому +1

      do you watch skibidi toilet?

    • @FangYuan-s2b
      @FangYuan-s2b 3 дні тому

      @@ZapayaGuy hahahahahaha wtf this channel is for programming 😂

  • @arbab_tariki
    @arbab_tariki 3 дні тому +198

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

    • @dylananderson20023
      @dylananderson20023 3 дні тому +7

      I think o1 would do better

    • @EmpinadoMaxbmdggTheSun
      @EmpinadoMaxbmdggTheSun 3 дні тому +11

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

    • @arbab_tariki
      @arbab_tariki 3 дні тому

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

    • @arbab_tariki
      @arbab_tariki 3 дні тому +1

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

    • @kautilyaconcepts
      @kautilyaconcepts 3 дні тому +5

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

  • @twixerclawford
    @twixerclawford 3 дні тому +62

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

    • @victorfunnyman
      @victorfunnyman День тому

      huh

    • @twixerclawford
      @twixerclawford День тому

      @victorfunnyman it's cute code bullet

    • @lucidmime
      @lucidmime День тому +2

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

    • @victorfunnyman
      @victorfunnyman День тому

      @@lucidmime exactly what I though lmao

    • @twixerclawford
      @twixerclawford День тому

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

  • @thoughted6069
    @thoughted6069 2 дні тому +13

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

  • @OmPatil-zj9uo
    @OmPatil-zj9uo 3 дні тому +16

    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 3 дні тому +69

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

  • @nubnoobbo
    @nubnoobbo 3 дні тому +12

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

  • @LOL-dd3xk
    @LOL-dd3xk День тому

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

  • @AllExistence
    @AllExistence 3 дні тому +12

    That pyramid has no bottom.

    • @Green-Code
      @Green-Code  3 дні тому +19

      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 3 дні тому +1

      Jesus loves you

    • @arandomcat-v9l
      @arandomcat-v9l 3 дні тому +1

      ​@@JesusPlsSaveMebro how did you get here

    • @JesusPlsSaveMe
      @JesusPlsSaveMe 3 дні тому

      ​@@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.

  • @WhateverOwO
    @WhateverOwO День тому

    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

  • @manuelteres7583
    @manuelteres7583 3 дні тому +2

    Beautiful stuff!

  • @Zomplexx
    @Zomplexx 3 дні тому +10

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

  • @1ue999
    @1ue999 2 дні тому +1

    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 3 дні тому +3

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

  • @NiffirgkcaJ
    @NiffirgkcaJ День тому

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

  • @EmpinadoMaxbmdggTheSun
    @EmpinadoMaxbmdggTheSun 3 дні тому +2

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

  • @bepositive271
    @bepositive271 3 дні тому +1

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

  • @ohimdabiggestbird
    @ohimdabiggestbird 3 дні тому

    this video should go viral under my supervision

  • @Awxefgh
    @Awxefgh 3 дні тому

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

  • @Mrindia-k8n
    @Mrindia-k8n 3 дні тому

    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

  • @pantopia3518
    @pantopia3518 3 дні тому +3

    1000 views in 1 hour bro is thriving

  • @mediumdifficulty1875
    @mediumdifficulty1875 3 дні тому

    Dithering would work so well with this (I think)

  • @s.s.q8153
    @s.s.q8153 3 дні тому +19

    I wanna donut

  • @dulcinealee3933
    @dulcinealee3933 3 дні тому +1

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

  • @msedovgamez
    @msedovgamez День тому

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

  • @incognito8547
    @incognito8547 3 дні тому

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

  • @ozunkeskin2380
    @ozunkeskin2380 День тому

    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. ❤

  • @Adiee5Priv
    @Adiee5Priv 2 дні тому

    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

  • @dusvn1484
    @dusvn1484 3 дні тому

    Bro I love your videos pleas upload more frequently

  • @RoyalBurrito101
    @RoyalBurrito101 3 дні тому +1

    great video!

  • @TheHeroCrafter
    @TheHeroCrafter 3 дні тому

    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 ;)

  • @FangYuan-s2b
    @FangYuan-s2b 3 дні тому +1

    I neeeeeeed it (thanks for video) ❤

  • @kevincrinklaw7422
    @kevincrinklaw7422 18 годин тому

    Hey, Pro-Tip, from a professional programmer.
    You don't have to format the code as a donut for it to work.
    Hope this helps!
    👍👍👍

  • @BestagonHexagon
    @BestagonHexagon 2 дні тому +1

    No, im ASCII-ing 4:32

  • @TheCoolestCrocodileEver
    @TheCoolestCrocodileEver 4 години тому

    What schools helped you the most with programming?

  • @f-8ght
    @f-8ght 3 дні тому +1

    very nice man

  • @kpunkt.klaviermusik
    @kpunkt.klaviermusik 3 дні тому

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

  • @BlunnyTV
    @BlunnyTV День тому

    I watched every vid need more
    Keep it going🔥

  • @ninjadk7093
    @ninjadk7093 2 дні тому

    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?

  • @persosultubo1289
    @persosultubo1289 3 дні тому

    What free course did you watch for C++ ?

  • @amna4uh
    @amna4uh День тому

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

  • @koitz5770
    @koitz5770 3 дні тому

    I enjoyed Rotation Matrices

  • @GokU-v9x8s
    @GokU-v9x8s 3 дні тому +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

  • @pranavsharma2416
    @pranavsharma2416 3 дні тому +2

    Bro is here to demotivate me again

  • @anilsapkal9277
    @anilsapkal9277 3 дні тому +1

    I wanna have that Simpsons 🍩🤩

  • @superprocz
    @superprocz День тому

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

  • @オリヤ星野アイ
    @オリヤ星野アイ 2 дні тому

    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"

  • @_kalabasaa
    @_kalabasaa 3 дні тому

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

  • @tristan1171
    @tristan1171 3 дні тому

    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?

  • @TypicalDev_1-bf9ky
    @TypicalDev_1-bf9ky 3 дні тому

    does brilliant teach linear algebra, and trigenometry?

  • @Zbezt
    @Zbezt 2 дні тому

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

  • @everything6800
    @everything6800 3 дні тому

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

  • @oldragna5866
    @oldragna5866 3 дні тому +1

    Bill cypher 😂

  • @f-8ght
    @f-8ght 3 дні тому

    I had watched all your videos on youtube

  • @verolyn8459
    @verolyn8459 3 дні тому +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

  • @ammaralaee1087
    @ammaralaee1087 3 дні тому

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

  • @yehiaabuelnasr7243
    @yehiaabuelnasr7243 3 дні тому

    now make the hardest one. A sphere.

  • @DMO1
    @DMO1 3 дні тому +1

    Donut rave!!

  • @angngocminh3830
    @angngocminh3830 3 дні тому

    was this on the internet before?

  • @SahilKumar-is2bf
    @SahilKumar-is2bf 3 дні тому

    Wooh man You're Crazy

  • @spoockybro
    @spoockybro 3 дні тому

    How does the rendering manege planes behind other planes?

  • @Pinothy
    @Pinothy 3 дні тому +9

    donut chain

  • @warmpianist
    @warmpianist 3 дні тому

    Teapot rotation

  • @Leonartist
    @Leonartist 12 годин тому

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

  • @P1E-D3V
    @P1E-D3V 3 дні тому

    wow that cool

  • @erenoguz3297
    @erenoguz3297 3 дні тому

    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  3 дні тому +1

      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 UA-cam studio to not include that bit, while also making sure everything else makes sense.
      Thanks for spotting it

  • @DemonDem-pl6oi
    @DemonDem-pl6oi 3 дні тому

    How is the guy so cool?

  • @LeetHaxington
    @LeetHaxington 2 дні тому

    wasn't this one of the meme creations from joma

  • @Hacky74
    @Hacky74 3 дні тому

    yoo dubs u motivate me to code

  • @bluevipergaming-r6m
    @bluevipergaming-r6m 3 дні тому

    Illuminati counter = 4

  • @MickeyMousePlayzz
    @MickeyMousePlayzz 3 дні тому

    D O N U T.

  • @Lawdasur_Reflex
    @Lawdasur_Reflex 2 дні тому

    informative

  • @xenosigcm
    @xenosigcm 3 дні тому

    Peak video💯💯💯💯

  • @HarmonieCool
    @HarmonieCool 3 дні тому

    motation ratices

  • @heckermangt
    @heckermangt 3 дні тому +1

    egg 🥚

  • @ciarlok7778
    @ciarlok7778 3 дні тому

    he gives me Dani vibes

  • @user-tw2kr6hg4r
    @user-tw2kr6hg4r 3 дні тому +1

    why use c++? its a horrible language and youre not really making use of what distinguishes it from c anyway. the code in the beginning didnt compile since you didnt specify the c standard, you have to add --std=c89 or gnu89 to avoid it defaulting to a standard version with breaking changes. in any case, avoid c++ as much as you possibly can, just use c or something better (zig, odin, or rust, dlang, go).

    • @user-tw2kr6hg4r
      @user-tw2kr6hg4r 3 дні тому +1

      i really cant stress this point enough, c++ is an abhorrent language, every other language is superior. never use c++, if it is not forced upon you.

  • @heckermangt
    @heckermangt 3 дні тому +1

    BRO PLEASE USE -o

    • @Green-Code
      @Green-Code  3 дні тому

      What do you mean?

    • @rubixube4239
      @rubixube4239 3 дні тому

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

    • @Green-Code
      @Green-Code  3 дні тому

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

  • @rssszz7208
    @rssszz7208 3 дні тому

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

  • @kingsecrecy
    @kingsecrecy 3 дні тому

    hi green code love your vidioes from india

  • @QuanNguyen-vb8wr
    @QuanNguyen-vb8wr 2 дні тому

    make the donut in opengl c++

  • @dreninfashion
    @dreninfashion 3 дні тому +1

    bro what is your IQ??

  • @theotherhive
    @theotherhive 3 дні тому

    donet :3

  • @Stepanchicko
    @Stepanchicko 3 дні тому

    ok

  • @ProSureString
    @ProSureString 3 дні тому +5

    D o u g h n u t

  • @Neko-san
    @Neko-san 3 дні тому +1

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

  • @lucaslevandoski2946
    @lucaslevandoski2946 3 дні тому

    c'mon man, don't make me type down that binary at the end to translate, I wanna know what that is but I don't want to type it all...
    help a bro that has little to no time available

  • @mmiisshhaa
    @mmiisshhaa 2 дні тому

    If anyone is interested, I created something similar on my channel :)

  • @EHMM
    @EHMM 3 дні тому

    -_-

  • @MH-sf6jz
    @MH-sf6jz 3 дні тому

    That is not dot product when multiplying two matrices or matrix and vectors, it’s just multiplication. Dot product is strictly vector to vector. Also, why are you using row vector when column vector is the standard?

  • @Mega-m3d
    @Mega-m3d 3 дні тому

    Bro he dont have idea about c++ he learned c++ in 3 days and designed a complex donut wtf