Let's code 3D Engine in Python. OpenGL Pygame Tutorial

preview_player
Показать описание
Warning! This video only explains the basics of working with 3D graphics using OpenGL through the ModernGL library. It is suitable for creating simple 3D applications, but for developing more serious things you should not adhere to the proposed class architecture.

And if you are interested in this video as a guide, then many things here can be simplified and optimized, and I suggest you watch (pay attention to the architecture of the application and classes) the following videos:

Github:

Code from video:

3D Cat model:

00:00 Intro
00:54 OpenGL Window
02:50 OpenGL Pipeline
03:54 Hello Triangle!
06:59 Hello Cube!
11:16 Texturing
14:50 Camera
18:10 Phong Lighting
22:54 Reorganization
26:33 Transformations
28:26 Gamma correction
30:04 Mipmaps, filtering
31:00 Load 3D model

#coderspace #python #opengl
Рекомендации по теме
Комментарии
Автор

Note. If you want to use the rotation order around the axes for the model X -> Y -> Z, then you should use the matrix rotation order from right to left ZYX

CoderSpaceChannel
Автор

I like how you purposefully leave bugs in the code and explain the mistake before fixing it a little while later. Awesome teaching style!

SuboptimalEng
Автор

This video has few years worth of knowledge regarding computer graphic's practices and techniques, compressed into 33 minutes. It's definitely one of the most valuable stuff I watched on Youtube ever.

StarFury
Автор

The best programming teacher in the world. Everything is explained clearly. The rhythm, the tone of voice, the background music manages to keep the level of attention high even for 30 minutes. And this is fabulous! Hope there are more tutorials for various types of lighting, mirror reflections, various materials, independent object animations.The sun has returned to shine inside the konsole

Thank you very much!

MarioAbbruscato
Автор

Great video!

I would absolutely love an OpenGL turorial style series as you mentioned at the end of the video
- not just for learning practical opengl but also about how it works behind the scenes in more detail (such as the pipeline, contexts VBO VAO explanations you gave) and in general about the mathematical aspects of computer graphics (such as the linear algebra stuff, the lighting and shading alogrithms).
Honestly just you mentioning these stuff briefly always gets me to pause the video and google them immediately.. takes me a couple of hours to finish your videos but I'm learning a bunch lol.

Anyways these videos are GOLD thank you!

donhippo
Автор

30 minute video, but a entire day to put it in practice. Great video! Thank you very much

DamianthTV
Автор

This is honestly one of the best tutorials i have seen, python makes it really easy to grasp, but all info applies in other languages... great work!

lukask.
Автор

Great video! Just a small correction: OpenGL is not right-handed nor left-handed at the geometry phase, it is only left-handed after rasterization, much like DirectX and all other graphics APIs. What determines what handedness is assumed, is how the projection matrix is generated. In this case, it uses GLM's function, which includes the Z-flip in the matrix it produces - this is what makes this assumption about the source vertex data being structured with a right-handed coordinate system. If you flip that z-negation back in the projection matrix that GLM perspective yields (or just construct it manually yourself) you can then use a left-handed coordinate system for your vertex data. OpenGL has no say in the matter, it is you that is multiplying your vertex data with that matrix that you yourself are also providing - all in your vertex shader. The only real requirement is that the output of the vertex shader's vertex positions are all left-handed. GLM just followed the very legacy 'convention' of 'assuming' that the incoming vertex data is right-handed, and so includes that z-flip in the perspective projection matrix that it's function produces. That's where that assumption is made, not in OpenGL itself. Way back, when OpenGL had it's own built-in perspective projection, it really was the case that you could say 'OpenGL is right-handed' (sorta..), but once it started requiering vertex shaders, that stopped being the case - and that's already decades ago.

AinurEru
Автор

Hands down the best tutorial on Pygame OpenGL I've ever seen.

thedebapriyakar
Автор

been using this alot to learn openGL for a project, i probably account for around a third of this videos views. thank you very much

jonomoth
Автор

This is pretty awesome, would love to see a 2D engine from start to finish.

scottcastle
Автор

I am brand new to DAW and soft soft - these tutorials are excellent an very helpful to get soone like up and running. Appreciate

picardr
Автор

Oh my god, thank you so much!!! I have been waiting for a tutorial like this, who would have guessed only the most sensible coder would make it ^w^.
Btw I subbed on 3 accounts, you deserved more.

icotwilight
Автор

This is really good. I will shill this next time someone asks how to get started with graphics programming.

theotherquou
Автор

Many thanks. Been trying to figure out how to use OpenGL/shaders and use them with pygame and this video has been the most helpful

azaias
Автор

Best python tutorial I ever seen so far! Thanks!!!

MeltedIce_
Автор

I like the speed of your videos, feels full of content. For experienced python programmers, all sounds smooth. Don't plan to make it slow ;)

PraveenKulkarnipraveen
Автор

Best open GL tutorial so far.... Thank you so much for making these... Subscribed 👍

zaqk
Автор

Oh my word! Another awesome video from Coder Space! As the other comments say, it is super condensed. I recommend going through it slowly, copying it whilst making notes.

Utterly brilliant.

Hope this adjusts the YouTube algorithm...

Temple_Cloud
Автор

That's why programming bis very powerful and awesome when the job is done.good work

acanimationfilmstudio