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
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.
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!
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 TH-cam. 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.
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.
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.
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.
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!😄
Hello, I have an issue with vertices being shown behind the camera. I want to study how to implement frustum culling into your project, but I’m not sure where to begin. Any suggestions?
I've been analyzing this engine and was successful to get proper perspective and camera view working on my project. However as I move the camera forward and go past an object, the object reappears and moves away from the screen when it really should be BEHIND the camera view. It seems that your engine is having this issue as well, so I was playing with both engines to see if can be fixed but no progress yet. I suspect it may has to do with the vertical asymptote of the tangent function approaching either direction of infinity as the camera gets closer to the world coordinate origin.
hi there, idk if you still care about this, but the way i solved this was realising that any coord with a z value (z buffer) greater than 1 was a vert in the phantom mirrored reappearing object. i just set any of these verts to have a y coord of 0, and then the numba function that checks if the coord is clipped will remove it along with all the other clipped verts
@@badamson Thank you for sharing. I just came back after years of busy work (very boring and time consuming stuff). Graphics programming really makes everything fun and refreshing.
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.
@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
please help I am having ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2946,) + inhomogeneous part. This error, can't figure out why numpy is giving this?
So I'm running numpy 1.24.3 and when I try to run the program I get a inhomogeneous shape error for when you create the faces np.array in the Object3D class Apparently from some stackoverflow answers it seems that this problem is fixed if you downgrade to a older version of numpy Unfortunately I was too lazy to do that and noticing that the shape of the faces object that you wanted to create in the Object3D is the same as that of the faces object you get in the constructor, only difference being is that it is all np.arrays instead of a normal array... I decided to replace self.faces = np.array([np.array(face) for face in faces]) with self.faces = faces and it worked..? idk honestly ima just leave it here if anyone has this error too and actually knows how to fix it
While seeing the video, I said to myself, "Sure, this channel has over 400 thousand subscribers." I noticed after watching the video that it only has 1.12 thousand subscribers. Now you want to make a video showing how to create a TH-cam Algorithm for youtube
I am newb and a bit lost when i try to run the code at this point 9:24 it returns two errors stating "RuntimeWarning: divide by zero encountered in divide vertexes /= vertexes[:, -1].reshape(-1, 1)" and "RuntimeWarning: invalid value encountered in divide vertexes /= vertexes[:, -1].reshape(-1, 1)" i know this probably is an easy fix and maybe ill fix it before i get a reply but thanks anyway in advance!
this project implements only simple concepts of 3D graphics, in your case you should look towards OpenGL or ready-made engines (Panda3D, UrsinaEngine, Harfang3D)
Really cool thing you have made here, but I have an issue. I'm at 9:25 and when I start the program the screen is green but i see no cube I checked through all the draw functions and they seem to be as they should I even tried drawing another line across the screen and that worked to Could you help me?
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?
tNice tutorials actually was, and I'm just starting myself, I have no idea what I'm doing but I have a ton of ideas in my head. Ti to figure tNice tutorials out
Is ther any sample of plane intersecting algorithm. I am looking for some calculations or code same like of how to get the line of intersection of 2 triangles in the space
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 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?
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!
A whole semester worth of classes in a single video, essential for my final exam and project, I owe you one.
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 TH-cam.
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
*I remember when I wrote my first 3D engine on the Commodore64 back in the mid-eighties*
I was so proud of myself too!!
The quality of this video is insane and im really happy for you it gets so much attention!!!
I wish this sort of video tutorial existed when I was young and learning about 3D engines and matrices.
This is by far the most underrated channel on TH-cam
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
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.
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 🔥🔥👍👍
😮😮😮😮😮😊😊😊😊😊
I paused as you went along and did the steps myself and that helped a TON.
You are very underrated my friend
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 implementation video on 3D engines
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 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
TNice tutorials tutorial is so useful,I tried tons of other tutorials but tNice tutorials was the best one
Wow, thank you for this most easily explanation. This will be my start of programming 3D models
Please do another video on this! Not just wireframe, actual sides/faces to the 3d shapes! Lighting, etc!
even on my weak computer the installation did not take much time, thank you very much
u deserve way more subs ..keep up the amazing work 💓💓
I just did! (ノ゚0゚)ノ
What a passion! What a dedication! What amazingness!
The introduction was very helpful, thanks!
Very good! Thank you so much. I have already know most of that video. But I got the little miss parts. Perfect.
Very helpful explanation in easy way for beginners to understand game programming ant its complex geomerty
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!😄
Bro has been coding since 1960... kudos
Hello, I have an issue with vertices being shown behind the camera. I want to study how to implement frustum culling into your project, but I’m not sure where to begin. Any suggestions?
Nice video man, clear and concise explanation! Thanks a lot!
Рад, что теперь у вас будет и иностранная аудитория
Wow finally I will make my own Blender ..thanks
Great tutorials 👍 subscribed 👍 keep up the good work.
TNice tutorials is video is amazing! thanks for posting.
Thank you very much, this is pure gold.
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.
This is just beyond amazing 💯
I wish we got this video long time ago so I can learn computer science more easily
Great video easy to understand. Thank you. You forgot to mention what graphics software did you use to make your animations.
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 🙃
You just deserved much more thab "just" over 300k subbers.
Congratulations !!! You crossed 1k
wow! it made my day! thanks! 🥳
Very nice :-) congratulations! Subscribed.
THANK YOU SO MUCH THIS WAS EXTREMELY HELPFUL :D
I've been analyzing this engine and was successful to get proper perspective and camera view working on my project. However as I move the camera forward and go past an object, the object reappears and moves away from the screen when it really should be BEHIND the camera view. It seems that your engine is having this issue as well, so I was playing with both engines to see if can be fixed but no progress yet. I suspect it may has to do with the vertical asymptote of the tangent function approaching either direction of infinity as the camera gets closer to the world coordinate origin.
need to implement Frustum Culling
hi there, idk if you still care about this, but the way i solved this was realising that any coord with a z value (z buffer) greater than 1 was a vert in the phantom mirrored reappearing object. i just set any of these verts to have a y coord of 0, and then the numba function that checks if the coord is clipped will remove it along with all the other clipped verts
@@badamson Thank you for sharing. I just came back after years of busy work (very boring and time consuming stuff). Graphics programming really makes everything fun and refreshing.
@@kimeg7294 i’m glad you’ve managed to catch a break! i’ve moved onto c++ vulkan stuff now and it’s a whole other level of complicated 😭😭😭
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.
Thanks for the video! Very helpful and easy to follow instructions
It's true, it is nice to look at the cube.
@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
very helpful and simple man.. i tNice tutorialnk i'm gonna see all your videos
Aweso tutorial bro! I like how you gets down to bus
Love your stuff! Big help!
s and a couple EDM and Dubstep goals for myself, and I guess I better start learning sowhere. Thanks for the great vid!
yours is perfect. These are going to takes loads of ti off the learning process.
bro thanks so much, you actually made soft soft easy to understand
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!
This was amazing man greate tutorial
Great mix of math basics & implementation tutorial. Which Python editor & Color Theme do you use ?
Thanks. This is Pycharm and monokai color scheme
Thank you So much for ur ti and support
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.
10:35 "You can bend over and turn around" I died💀😂
please help I am having
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2946,) + inhomogeneous part.
This error, can't figure out why numpy is giving this?
Great tutorial, mine worked! But for some reason Files I export from blender can't be read
my fav and tysvm for this tutorial it was helpful❤️.
What text-to-speech software do you use? It's pretty unnoticable and sounds great!
cloud.google.com/text-to-speech
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
Wow 😳😲 amazing 😍 video
Thank you so much this helped a lot!!!! You saved my life
Excellent work
So I'm running numpy 1.24.3 and when I try to run the program I get a inhomogeneous shape error for when you create the faces np.array in the Object3D class
Apparently from some stackoverflow answers it seems that this problem is fixed if you downgrade to a older version of numpy
Unfortunately I was too lazy to do that and noticing that the shape of the faces object that you wanted to create in the Object3D is the same as that of the faces object you get in the constructor, only difference being is that it is all np.arrays instead of a normal array...
I decided to replace
self.faces = np.array([np.array(face) for face in faces])
with
self.faces = faces
and it worked..?
idk honestly ima just leave it here if anyone has this error too and actually knows how to fix it
you saved my grades thank you
While seeing the video, I said to myself, "Sure, this channel has over 400 thousand subscribers." I noticed after watching the video that it only has 1.12 thousand subscribers. Now you want to make a video showing how to create a TH-cam Algorithm for youtube
Soo good video content.
Thnx buddy
I see you are a man of culture as well
Awesome job man 😮😮😮
If you set the playback speed to 0.5 or lower the tutorial becomes actually followable! :D
I am newb and a bit lost when i try to run the code at this point 9:24 it returns two errors stating
"RuntimeWarning: divide by zero encountered in divide vertexes /= vertexes[:, -1].reshape(-1, 1)"
and
"RuntimeWarning: invalid value encountered in divide vertexes /= vertexes[:, -1].reshape(-1, 1)"
i know this probably is an easy fix and maybe ill fix it before i get a reply but thanks anyway in advance!
where I’d record one track of the soft and than use a second Edison to record scrubbing through the soft to mimic a wave table.
I just smashed the subscribe button
7:30 why has the w changed to a different number ? In all earlier matrix multiplications, you didn't change the w value
Thanks for your tutorial!!! I have a question, are there any posibility to load textures in your code (.mtl associated to the .obj)?
this project implements only simple concepts of 3D graphics, in your case you should look towards OpenGL or ready-made engines (Panda3D, UrsinaEngine, Harfang3D)
can you code up a 4d game? I think that would make a great video.
That's an interesting tutorial.
Really cool thing you have made here, but I have an issue.
I'm at 9:25 and when I start the program the screen is green but i see no cube
I checked through all the draw functions and they seem to be as they should
I even tried drawing another line across the screen and that worked to
Could you help me?
There is a link to the project code in the video description.
Nice video, Thanks!
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 keep coming back to those basics videos because I STILL don't know how to properly use the software. I'm gonna cry
Nice job!
Great video! How would I add texturing to my imported OBJ models though?
tNice tutorials actually was, and I'm just starting myself, I have no idea what I'm doing but I have a ton of ideas in my head. Ti to figure tNice tutorials out
Please create a further Series
I wish I could program as fast as you do. With that speed I could triple the number of programs produced.😊
amazing video
DUDE, I got so frustrated 'cause of that problem, thanks a lot!
Is ther any sample of plane intersecting algorithm.
I am looking for some calculations or code same like of how to get the line of intersection of 2 triangles in the space
Hi, can anyone answer me wht does he use pi / 3 to calculate the v_fov at 6:00?
Ok and do you got a video for how to load a plugin in to the software ?
Pretty Cool, Thanks!