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
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
Don't worry. I just read that python will be faster in the next version.
How do you make that voice?
do you know what techstack they used in blender ?
>from scratch
lololol
that means no libraries, right?
it will always be much slower than strong-typed compiled languages, by design
As someone with a degree in Computer Graphics, this 15 minute video pretty much sums up 2 entire years of university studies. Good job
can you give me advice recommendations I'm a beginner in Python
wtf do you do on such a degree lol, i study computer science and this covers only half of the lecture
@@aleksanderniemirka5258 even if that would be a lot
@@zwwx2142did u ever find out how to get gud?
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.
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!
This is by far the best beginner friendly game engine tutorial. Good job!
indeed, very comprehensive!
😆 😆 😆
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.
but it's really hard to listen
@@user-dh8oi2mk4f why would I?
A whole semester worth of classes in a single video, essential for my final exam and project, I owe you one.
I paused as you went along and did the steps myself and that helped a TON.
The quality of this video is insane and im really happy for you it gets so much attention!!!
*I remember when I wrote my first 3D engine on the Commodore64 back in the mid-eighties*
I was so proud of myself too!!
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.
I wish this sort of video tutorial existed when I was young and learning about 3D engines and matrices.
The introduction was very helpful, thanks!
Nice video man, clear and concise explanation! Thanks a lot!
I feel the need to congratulate you, because this video was hard to make. Keep up the good work mate! Well done!
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
This is just beyond amazing 💯
THANK YOU SO MUCH THIS WAS EXTREMELY HELPFUL :D
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.
@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.
@@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.
I am also interested in seeing your code step by step
Thanks for the video! Very helpful and easy to follow instructions
Thank you very much, this is pure gold.
This is by far the most underrated channel on RUclips
Love your stuff! Big help!
This is by far the best implementation video on 3D engines
Subscribed, liked, added to favorites and sent this video to a bunch of friends. Great job with the video man, you deserve infinite success
I did the same as well 🔥🔥👍👍
😮😮😮😮😮😊😊😊😊😊
Wow, thank you for this most easily explanation. This will be my start of programming 3D models
Very good! Thank you so much. I have already know most of that video. But I got the little miss parts. Perfect.
What a passion! What a dedication! What amazingness!
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.
This was amazing man greate tutorial
bro thanks so much, you actually made soft soft easy to understand
Very well done!
Very nice :-) congratulations! Subscribed.
Great tutorials 👍 subscribed 👍 keep up the good work.
This is so cool!
You are very underrated my friend
even on my weak computer the installation did not take much time, thank you very much
TNice tutorials tutorial is so useful,I tried tons of other tutorials but tNice tutorials was the best one
Nice video, Thanks!
Pretty Cool, Thanks!
Thank you so much this helped a lot!!!! You saved my life
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!😄
Nice job!
Aweso tutorial bro! I like how you gets down to bus
Great video. Thanks
Excellent work
It's true, it is nice to look at the cube.
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.
Yes, most people prefer the term "Vertices". Both are perfectly acceptable according to:
www.merriam-webster.com/dictionary/vertexes
TNice tutorials is video is amazing! thanks for posting.
Wow 😳😲 amazing 😍 video
u deserve way more subs ..keep up the amazing work 💓💓
I just did! (ノ゚0゚)ノ
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.
amazing video
thanks for sharing, so cool,!
wow!
thanks!
yours is perfect. These are going to takes loads of ti off the learning process.
This is great and hella interesting
That's an interesting tutorial.
Wow finally I will make my own Blender ..thanks
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.
10:35 "You can bend over and turn around" I died💀😂
my fav and tysvm for this tutorial it was helpful❤️.
Very helpful explanation in easy way for beginners to understand game programming ant its complex geomerty
Congratulations !!! You crossed 1k
wow! it made my day! thanks! 🥳
This is pure amazing
thanks so much man
Right here with ya, bro
Amazing
very helpful and simple man.. i tNice tutorialnk i'm gonna see all your videos
s and a couple EDM and Dubstep goals for myself, and I guess I better start learning sowhere. Thanks for the great vid!
This was insane
Thanks so much
Please do another video on this! Not just wireframe, actual sides/faces to the 3d shapes! Lighting, etc!
Thank you So much for ur ti and support
Great video easy to understand. Thank you. You forgot to mention what graphics software did you use to make your animations.
Wow epic winz.. nice
You just deserved much more thab "just" over 300k subbers.
you saved my grades thank you
U r a math and python genius
Bro has been coding since 1960... kudos
NICE
Soo good video content.
Thnx buddy
i love u so much bro, thanks very much
thank you very very very much, you help me a lot
I just smashed the subscribe button
Instant sub
Thanks!
Thank you very much!
Great mix of math basics & implementation tutorial. Which Python editor & Color Theme do you use ?
Thanks. This is Pycharm and monokai color scheme
You catch on really fast, it seems complex but once you learn the basics it pretty much branches into experintation
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!
I keep coming back to those basics videos because I STILL don't know how to properly use the software. I'm gonna cry
What text-to-speech software do you use? It's pretty unnoticable and sounds great!
cloud.google.com/text-to-speech
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.
Great video! How would I add texturing to my imported OBJ models though?
Thank you sir
@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
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
thanks. this is really amazing and unexpected for me 🙃
OOOOOOOOOOOOOO this is gonna be good.
Рад, что теперь у вас будет и иностранная аудитория
nice.
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
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?
I see you are a man of culture as well