Let's code 3D Engine in Python from Scratch

Поделиться
HTML-код
  • Опубликовано: 13 май 2022
  • This is a Tutorial on how to create a 3D Software Renderer in Python from Scratch. Numpy and Pygame libraries are used to create such a 3D Renderer (Engine)
    More Python Projects: • Python Projects
    SourceCode:
    github.com/StanislavPetrovV/S...
    #coderspace #python #3dengine #pygame #numpy
    #programming #coding #programmer #developer #technology #code

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

  • @CoderSpaceChannel
    @CoderSpaceChannel  2 года назад +166

    This project was created to learn the basics of 3D. Of course, in terms of performance, Python is not the best option for this kind of thing, but it was pretty fun.
    And sorry for some grammatical errors

    • @starklosch
      @starklosch 2 года назад +6

      Don't worry. I just read that python will be faster in the next version.

    • @atharvkumar2564
      @atharvkumar2564 2 года назад +2

      How do you make that voice?

    • @ak-gi3eu
      @ak-gi3eu 2 года назад

      do you know what techstack they used in blender ?

    • @aaaowski7048
      @aaaowski7048 Год назад +2

      >from scratch
      lololol
      that means no libraries, right?

    • @borisu77
      @borisu77 Год назад

      it will always be much slower than strong-typed compiled languages, by design

  • @backroomsorigin
    @backroomsorigin Год назад +188

    As someone with a degree in Computer Graphics, this 15 minute video pretty much sums up 2 entire years of university studies. Good job

    • @zwwx2142
      @zwwx2142 Год назад +1

      can you give me advice recommendations I'm a beginner in Python

    • @aleksanderniemirka5258
      @aleksanderniemirka5258 Год назад +7

      wtf do you do on such a degree lol, i study computer science and this covers only half of the lecture

    • @popbob4780
      @popbob4780 Год назад +2

      @@aleksanderniemirka5258 even if that would be a lot

    • @SHORTstudios100
      @SHORTstudios100 9 месяцев назад

      @@zwwx2142did u ever find out how to get gud?

    • @marcocazar4266
      @marcocazar4266 2 месяца назад

      Genial, yo hice lo mismo con vectores, pero es lento, con matrices por lo visto es más fácil y rápido.
      Muy buen video.

  • @stafan102938
    @stafan102938 2 года назад +84

    This has seriously helped me understand so many complex topics that I've been trying to get my head around for so long but have never clicked. Now I can go away and learn about them properly in depth with the context for their use in my mind. Great work, seriously!

  • @djangofakkeldij
    @djangofakkeldij 2 года назад +248

    This is by far the best beginner friendly game engine tutorial. Good job!

    • @koferperk
      @koferperk 2 года назад +2

      indeed, very comprehensive!

    • @holygraphite1292
      @holygraphite1292 2 года назад +1

      😆 😆 😆

    • @user-dh8oi2mk4f
      @user-dh8oi2mk4f 2 года назад +8

      I wouldn't really call this a game engine tutorial, more like a computer graphics tutorial. For any real game engine, you would definitely want to access the GPU with something like OpenGL or DirectX.

    • @fulcanelly
      @fulcanelly Год назад +1

      but it's really hard to listen

    • @fulcanelly
      @fulcanelly Год назад

      @@user-dh8oi2mk4f why would I?

  • @josemfernandeza5979
    @josemfernandeza5979 9 месяцев назад +3

    A whole semester worth of classes in a single video, essential for my final exam and project, I owe you one.

  • @sheylagreenperez1196
    @sheylagreenperez1196 Год назад +1

    I paused as you went along and did the steps myself and that helped a TON.

  • @slimfpv
    @slimfpv 2 года назад +2

    The quality of this video is insane and im really happy for you it gets so much attention!!!

  • @johnsmith1953x
    @johnsmith1953x Год назад +6

    *I remember when I wrote my first 3D engine on the Commodore64 back in the mid-eighties*
    I was so proud of myself too!!

  • @tristanv6202
    @tristanv6202 Год назад +3

    This is wonderful and I have never seen such clean and effective python tutorial like this. I can only image what you could do with TensorFlow or PyTorch.

  • @ristopaasivirta9770
    @ristopaasivirta9770 Год назад +3

    I wish this sort of video tutorial existed when I was young and learning about 3D engines and matrices.

  • @oeunsothearin9696
    @oeunsothearin9696 Год назад +1

    The introduction was very helpful, thanks!

  • @arrozyadifalaqi9292
    @arrozyadifalaqi9292 Год назад +2

    Nice video man, clear and concise explanation! Thanks a lot!

  • @unluckyaf7673
    @unluckyaf7673 2 года назад +1

    I feel the need to congratulate you, because this video was hard to make. Keep up the good work mate! Well done!

  • @7addisalem77
    @7addisalem77 Год назад +2

    This is by far the best beginner friendly game engine tutorial as a beginer i still fight to understand it but keep up the amazing job bro

  • @timpi4ever
    @timpi4ever 2 года назад +2

    This is just beyond amazing 💯

  • @kossairezig
    @kossairezig Год назад +1

    THANK YOU SO MUCH THIS WAS EXTREMELY HELPFUL :D

  • @skilz8098
    @skilz8098 2 года назад +36

    Very nice job and clear explanation of laying down the basic foundations in such a short period of time and not bad for a wireframe renderer within Python.
    It still has a ways to go when it comes to adding in materials and textures to each of the faces. Then you have lighting and shadow casting calculations which leads to shaders and pre and post processing within the graphics pipeline.
    After that, then it's a matter of building a Scene Graph where one object node can be in a nested tree like structure making it either a parent or a child node of another. Then once you have your tree structure or scene graph in place comes the concept of partitioning it to reduce your polygon count during the render frame calls such as quad trees or octrees as well as using or implementing a batch rendering process...
    There are many more things that go into a 3D Engine such as collisions, physics, particle generators, animations, GUIs, HUDs, etc... I'd happily call it a 3D Renderer or Model Viewer at this point, yet it still has a lot to be desired before calling it an "engine"... I'm only saying this not to put down your work, but from personal experience since I have made a 3D Graphics/Game Engine from Scratch in C++... And this here only touches the ground work or the basics...
    Keep up the good work, I'd love to see future videos to expand on this project. Maybe make a series out of it...
    P.S. Also most of this processing and drawing of vertices within this video is being done on the CPU... Most of this ought to be processed and passed off to the GPU... The GPU can process all of the vertex, pixel, index, lighting and shading calculations much more efficiently and significantly faster than the CPU. This is where graphics APIs such as OpenGL, Vulkan and DirectX come into play especially with their Graphics and Shader Pipelines.

    • @quefour9710
      @quefour9710 2 года назад +2

      @skilz8098 Do you have a video series where you walk through the design and coding of your gaming engine you mentioned in your response….? I am interested in learning if you have such a video series on building a 3D Engine.

    • @skilz8098
      @skilz8098 2 года назад +6

      @@quefour9710 Unfortunately I do not. And I spent several years in researching and learning how to build one. This goes back from about 2003 - 2015. It wasn't overnight and there is a lot involved. Currently I don't have the time nor the proper equipment to make a video series as I'm working a full time job.
      I would have referred you to some of the resources that I used but again many of them no longer exist. I gained information from 3DBuzz, MarekKnows and a few other sites that no longer exist. You can find some of their material on RUclips.
      I also purchases a handful of books that are great reference materials but are now a bit dated yet their general principles still apply...
      There is a couple of websites that are still available that I can refer you to that is very good and is still up and running and they are www.learnopengl.com and www.rastertek.com and through them and other resources I've learned both the OpenGL and DirectX APIs as well as GLSL and HLSL.
      I also started to learn Vulkan too along with Spir-V however, instead of writing direct Spir-V code, I used tools to convert GLSL automatically into compiled Spir-V code.
      There's plenty of information out there, you just have to be willing to put in the time to do the research.
      And this only involves the "programming" side of things. You'll also want to brush up on your math skills, especially geometry, trigonometry, linear algebra(vectors, matrices and systems of linear equations), as well as classical physics.

    • @brunorcabral
      @brunorcabral 2 года назад +2

      I am also interested in seeing your code step by step

  • @yohanaasintha5562
    @yohanaasintha5562 Год назад +1

    Thanks for the video! Very helpful and easy to follow instructions

  • @locowachipanga561
    @locowachipanga561 Год назад +1

    Thank you very much, this is pure gold.

  • @eureka334
    @eureka334 Год назад +1

    This is by far the most underrated channel on RUclips

  • @Mochammadsholehanwari
    @Mochammadsholehanwari Год назад +1

    Love your stuff! Big help!

  • @arjoai
    @arjoai 5 месяцев назад

    This is by far the best implementation video on 3D engines

  • @dr4kk0nnysinc59
    @dr4kk0nnysinc59 2 года назад +24

    Subscribed, liked, added to favorites and sent this video to a bunch of friends. Great job with the video man, you deserve infinite success

    • @p.k.953
      @p.k.953 2 года назад +1

      I did the same as well 🔥🔥👍👍

    • @Show-wi7cw
      @Show-wi7cw 8 месяцев назад

      😮😮😮😮😮😊😊😊😊😊

  • @alexl4447
    @alexl4447 10 месяцев назад

    Wow, thank you for this most easily explanation. This will be my start of programming 3D models

  • @hacerdemirel9833
    @hacerdemirel9833 Год назад +2

    Very good! Thank you so much. I have already know most of that video. But I got the little miss parts. Perfect.

  • @homemrisonho5051
    @homemrisonho5051 2 года назад +10

    What a passion! What a dedication! What amazingness!

  • @hamzaf19
    @hamzaf19 4 месяца назад

    7:29 Thank you for explaining that one! I had issues really understanding the fourth homogeneous coordinate but now it's all made clear. Insanely instructive video.

  • @hugowinnberg
    @hugowinnberg 2 года назад

    This was amazing man greate tutorial

  • @widizeiga3120
    @widizeiga3120 Год назад

    bro thanks so much, you actually made soft soft easy to understand

  • @janjamniksrpcic4517
    @janjamniksrpcic4517 Год назад

    Very well done!

  • @Radu
    @Radu 2 года назад +1

    Very nice :-) congratulations! Subscribed.

  • @teslastellar
    @teslastellar Год назад +1

    Great tutorials 👍 subscribed 👍 keep up the good work.

  • @SudipBishwakarma
    @SudipBishwakarma 2 года назад +1

    This is so cool!

  • @samarthpyati2855
    @samarthpyati2855 2 года назад +3

    You are very underrated my friend

  • @Somonreactionbd
    @Somonreactionbd Год назад +1

    even on my weak computer the installation did not take much time, thank you very much

  • @twitch.sae7
    @twitch.sae7 Год назад

    TNice tutorials tutorial is so useful,I tried tons of other tutorials but tNice tutorials was the best one

  • @user-bi9cg8oe3u
    @user-bi9cg8oe3u 5 месяцев назад

    Nice video, Thanks!

  • @FilterYT
    @FilterYT 2 года назад

    Pretty Cool, Thanks!

  • @kfirsw
    @kfirsw Год назад

    Thank you so much this helped a lot!!!! You saved my life

  • @AlpagaCoding
    @AlpagaCoding 5 месяцев назад

    Amazing! Thanks so much for this, I have been studying a bit of theory about this, and was looking for a practical example using python, it helped me a lot, please make more videos like this!😄

  • @atibyte
    @atibyte 8 месяцев назад

    Nice job!

  • @dorukkarall9631
    @dorukkarall9631 Год назад

    Aweso tutorial bro! I like how you gets down to bus

  • @ChrisHalden007
    @ChrisHalden007 2 года назад

    Great video. Thanks

  • @codecaine
    @codecaine Год назад

    Excellent work

  • @coolbrotherf127
    @coolbrotherf127 Год назад

    It's true, it is nice to look at the cube.

  • @ivanmironov599
    @ivanmironov599 Год назад +4

    For those following the video, when writing out the code, it should be noted that "vertexes" is not a word and will not register IntelliSense to pop up, but "vertices" will.

    • @CoderSpaceChannel
      @CoderSpaceChannel  Год назад +5

      Yes, most people prefer the term "Vertices". Both are perfectly acceptable according to:
      www.merriam-webster.com/dictionary/vertexes

  • @tibetphoto585
    @tibetphoto585 Год назад

    TNice tutorials is video is amazing! thanks for posting.

  • @its_code
    @its_code 2 года назад +1

    Wow 😳😲 amazing 😍 video

  • @theshoulderofgiants
    @theshoulderofgiants 2 года назад +12

    u deserve way more subs ..keep up the amazing work 💓💓

  • @darklaker
    @darklaker 11 месяцев назад

    Clean and powerful code, i'll take the idea to test a dual camera projection on nreal air glasses since they are capable of showing stereo images. Thanks a lot.

  • @Saw-qv3bl
    @Saw-qv3bl 2 года назад +1

    amazing video

  • @anhnhat35
    @anhnhat35 2 года назад

    thanks for sharing, so cool,!

  • @kazitahmin4535
    @kazitahmin4535 Год назад

    wow!
    thanks!

  • @abdallahgaming548
    @abdallahgaming548 Год назад

    yours is perfect. These are going to takes loads of ti off the learning process.

  • @hariangr
    @hariangr 2 года назад

    This is great and hella interesting

  • @KartikayBagla
    @KartikayBagla 2 года назад

    That's an interesting tutorial.

  • @user-ch9zd8ev9z
    @user-ch9zd8ev9z 20 дней назад

    Wow finally I will make my own Blender ..thanks

  • @starklosch
    @starklosch 2 года назад +4

    Nice video. Perhaps it would have been a good idea to mention that you used row major matrices and post multiplication. Notation may be confusing.

  • @ThiruvalluvanKamaraj
    @ThiruvalluvanKamaraj 4 месяца назад

    10:35 "You can bend over and turn around" I died💀😂

  • @user-qd3rt6py7k
    @user-qd3rt6py7k Год назад

    my fav and tysvm for this tutorial it was helpful❤️.

  • @farazumer7961
    @farazumer7961 Год назад

    Very helpful explanation in easy way for beginners to understand game programming ant its complex geomerty

  • @atharvkumar2564
    @atharvkumar2564 2 года назад

    Congratulations !!! You crossed 1k

  • @justkez2359
    @justkez2359 2 года назад

    This is pure amazing

  • @mydoll.sweetdoll9540
    @mydoll.sweetdoll9540 Год назад

    thanks so much man

  • @AK-jl6jy
    @AK-jl6jy Год назад

    Right here with ya, bro

  • @dataslid
    @dataslid 2 года назад

    Amazing

  • @Potatoinc-
    @Potatoinc- Год назад

    very helpful and simple man.. i tNice tutorialnk i'm gonna see all your videos

  • @Noliv3
    @Noliv3 Год назад

    s and a couple EDM and Dubstep goals for myself, and I guess I better start learning sowhere. Thanks for the great vid!

  • @collinthomas6288
    @collinthomas6288 2 года назад

    This was insane

  • @aaaaaaaaaaanys592
    @aaaaaaaaaaanys592 Год назад

    Thanks so much

  • @xskerrittx1
    @xskerrittx1 Год назад +3

    Please do another video on this! Not just wireframe, actual sides/faces to the 3d shapes! Lighting, etc!

  • @sebastienramdani985
    @sebastienramdani985 Год назад

    Thank you So much for ur ti and support

  • @yolamontalvan9502
    @yolamontalvan9502 7 месяцев назад +2

    Great video easy to understand. Thank you. You forgot to mention what graphics software did you use to make your animations.

  • @omnigeddon
    @omnigeddon 2 года назад

    Wow epic winz.. nice

  • @mikey-zk9nd
    @mikey-zk9nd Год назад

    You just deserved much more thab "just" over 300k subbers.

  • @ilookintofuture
    @ilookintofuture 27 дней назад

    you saved my grades thank you

  • @tech_duniya
    @tech_duniya 2 года назад

    U r a math and python genius

  • @calculuslifer4024
    @calculuslifer4024 Год назад

    Bro has been coding since 1960... kudos

  • @perseusz1691
    @perseusz1691 Год назад

    NICE

  • @rizzbod
    @rizzbod Год назад

    Soo good video content.
    Thnx buddy

  • @meditationandrelax6288
    @meditationandrelax6288 Год назад

    i love u so much bro, thanks very much

  • @MohamedSaeed-iv5dp
    @MohamedSaeed-iv5dp Год назад

    thank you very very very much, you help me a lot

  • @lightyagami4530
    @lightyagami4530 Год назад

    I just smashed the subscribe button

  • @starn1888
    @starn1888 2 года назад

    Instant sub

  • @HazardousAbacus
    @HazardousAbacus Год назад

    Thanks!

  • @raphofthehills4405
    @raphofthehills4405 2 года назад +2

    Great mix of math basics & implementation tutorial. Which Python editor & Color Theme do you use ?

  • @alessandromarin3803
    @alessandromarin3803 Год назад +4

    You catch on really fast, it seems complex but once you learn the basics it pretty much branches into experintation

    • @JessicaMorgani
      @JessicaMorgani Год назад +1

      Can you use the code on this video as an engine? it seems to me like you'll have to code the equaltion again for every object!

  • @hxds299
    @hxds299 Год назад

    I keep coming back to those basics videos because I STILL don't know how to properly use the software. I'm gonna cry

  • @CubixCreations
    @CubixCreations 2 года назад +1

    What text-to-speech software do you use? It's pretty unnoticable and sounds great!

  • @smallbluemachine
    @smallbluemachine Год назад

    It's a great look at the fundamentals behind 3D geometry. -Also why you don't use Python if you do anything seriously in this area.

  • @justaneric
    @justaneric 10 месяцев назад

    Great video! How would I add texturing to my imported OBJ models though?

  • @SSibi
    @SSibi Год назад

    Thank you sir

  • @astaghfirullahalzimastaghf3648
    @astaghfirullahalzimastaghf3648 Год назад +1

    @4:08 for 3d vector in python is it better to represent it using tuple instead of creating a class? because if we create a class we can do operator overloading for translation and scaling when required instead of multiply by 4x4 matrix

  • @atharvkumar2564
    @atharvkumar2564 2 года назад

    I am your subscriber since you had 50 subs, today you have 973 subscriber.I like to see your channel grow in just three days + 500 subs in three days

    • @CoderSpaceChannel
      @CoderSpaceChannel  2 года назад

      thanks. this is really amazing and unexpected for me 🙃

  • @costelinha1867
    @costelinha1867 2 года назад

    OOOOOOOOOOOOOO this is gonna be good.

  • @user-cw2gj2vw7w
    @user-cw2gj2vw7w 2 года назад +1

    Рад, что теперь у вас будет и иностранная аудитория

  • @marshelene
    @marshelene Год назад

    nice.

  • @HabiburRahman-dh7oy
    @HabiburRahman-dh7oy Год назад

    Thanks for lesson number one I'm going to leave ssages on a few of your posts and maybe even a few links to soft I make in the

  • @nobafan7515
    @nobafan7515 9 месяцев назад

    Will you be able to cover 3d model animations? I heard early 3d games had to make characters out of multiple objs until they found a way to make character models more realisticallythat bend and morph the mesh. Can you do that some day?

  • @osamahalghamdi9955
    @osamahalghamdi9955 Год назад

    I see you are a man of culture as well