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

  Рет қаралды 216,124

Coder Space

Coder Space

Күн бұрын

Пікірлер: 267
@CoderSpaceChannel
@CoderSpaceChannel 2 жыл бұрын
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
@thereborne5219
@thereborne5219 2 жыл бұрын
could you please make a tutorial on how i could make first person movement/camera with py and opengl?
@CoderSpaceChannel
@CoderSpaceChannel 2 жыл бұрын
@@thereborne5219 The implementation of such a camera will be exactly the same as in this project. And by the way, PyOpengl and ModernGL can be used together (for version 3.3 and higher)
@galtechtv4239
@galtechtv4239 2 жыл бұрын
​@@thereborne5219 you can change move() function of camera to this to have a "fps" movement def move(self): velocity = SPEED * self.app.delta_time keys = pg.key.get_pressed() if keys[pg.K_z]: #forward forward = glm.normalize(glm.cross(self.right, glm.vec3(0, 1, 0))) forward.y = 0 self.position -= forward * velocity if keys[pg.K_s]: #backward forward = glm.normalize(glm.cross(self.right, glm.vec3(0, 1, 0))) forward.y = 0 self.position += forward * velocity if keys[pg.K_q]: #left self.position -= self.right * velocity if keys[pg.K_d]: #right self.position += self.right * velocity if keys[pg.K_SPACE]: #up self.position += (0, velocity, 0) if keys[pg.K_LCTRL]: #down self.position -= (0, velocity, 0)
@easydraw3420
@easydraw3420 2 жыл бұрын
Can you tell me what theme you use in pycharm please?
@CoderSpaceChannel
@CoderSpaceChannel 2 жыл бұрын
@@easydraw3420 color scheme: Monokai
@SuboptimalEng
@SuboptimalEng 2 жыл бұрын
I like how you purposefully leave bugs in the code and explain the mistake before fixing it a little while later. Awesome teaching style!
@SweFromSe
@SweFromSe Жыл бұрын
att first i thought it was sarcassim
@rileylecaptain113
@rileylecaptain113 11 ай бұрын
Amazing way to show what errors you would come across and give an idea on how you would fix it.
@StarFury2
@StarFury2 2 жыл бұрын
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 KZbin ever.
@Lampe2020
@Lampe2020 Жыл бұрын
It's actually a tutorial I could easily understand and follow! I've watched many programming tutorials but rarely were they that good.
@kommanderkeen
@kommanderkeen Жыл бұрын
I just love you videos man! Thanks
@CoderSpaceChannel
@CoderSpaceChannel Жыл бұрын
And thank you very much!
@donhippo8305
@donhippo8305 2 жыл бұрын
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!
@DamianthTV
@DamianthTV Жыл бұрын
30 minute video, but a entire day to put it in practice. Great video! Thank you very much
@MarioAbbruscato
@MarioAbbruscato 2 жыл бұрын
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!
@carstenschmucker9140
@carstenschmucker9140 2 жыл бұрын
Hmm, sounds to me more like a (very good) computer voice?!
@markm1514
@markm1514 Жыл бұрын
ChatGPT lit cuh
@lukask.3465
@lukask.3465 2 жыл бұрын
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!
@ProgrammingWithRook
@ProgrammingWithRook Жыл бұрын
Honestly it doesn't, you can not take anything what so ever from this tutorial and apply it to C,c++,java... there is no GL commands anywhere.
@ProgrammingWithRook
@ProgrammingWithRook Жыл бұрын
apart from the window context ( window hints)
@jonomoth2581
@jonomoth2581 2 жыл бұрын
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
@icotwilight8597
@icotwilight8597 2 жыл бұрын
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.
@thedebapriyakar
@thedebapriyakar 2 жыл бұрын
Hands down the best tutorial on Pygame OpenGL I've ever seen.
@PraveenKulkarnipraveen
@PraveenKulkarnipraveen Жыл бұрын
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 ;)
@picardr6
@picardr6 2 жыл бұрын
I am brand new to DAW and soft soft - these tutorials are excellent an very helpful to get soone like up and running. Appreciate
@Temple_Cloud
@Temple_Cloud 9 ай бұрын
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 KZbin algorithm...
@Temple_Cloud
@Temple_Cloud 9 ай бұрын
Oh, and my personal tweak to 'camera.py' to make it work how I like it. Just inverts the axis and removes the clamping (for other who are learning and like it this way). def rotate(self): rel_x, rel_y = pg.mouse.get_rel() self.yaw += rel_x * SENSITIVITY self.pitch -= rel_y * SENSITIVITY # Invert the pitch angle (non-flight controls) # Keep the angles within 0 to 359 degrees. self.yaw %= 360 # Keep the yaw angle within 0 to 359 degrees self.pitch %= 360 # Keep the yaw angle within 0 to 359 degrees # Reset the mouse position to the center of the screen on each frame # This prevents the mouse from reaching the edge of the screen and preventing camera movement. pg.mouse.set_pos(self.app.WIN_SIZE[0] // 2, self.app.WIN_SIZE[1] // 2) Thanks again for an ace tutorial!
@azaias
@azaias Жыл бұрын
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
@theotherquou
@theotherquou 2 жыл бұрын
This is really good. I will shill this next time someone asks how to get started with graphics programming.
@AinurEru
@AinurEru 2 жыл бұрын
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.
@scottcastle9119
@scottcastle9119 2 жыл бұрын
This is pretty awesome, would love to see a 2D engine from start to finish.
@AizarkLizard
@AizarkLizard 10 ай бұрын
Cool author. Cool lesson. There is very little open information on this issue. Thank you for your work. I would be glad if you continue to release something further on this topic.
@zaqk2
@zaqk2 Жыл бұрын
Best open GL tutorial so far.... Thank you so much for making these... Subscribed 👍
@MeltedIce_
@MeltedIce_ 2 жыл бұрын
Best python tutorial I ever seen so far! Thanks!!!
@sanador2826
@sanador2826 2 жыл бұрын
Excellent video! I plan on using openGL to do physics simulations so I am excited to implement some of this. :)
@acanimationfilmstudio1018
@acanimationfilmstudio1018 2 жыл бұрын
That's why programming bis very powerful and awesome when the job is done.good work
@zaneaussie
@zaneaussie Жыл бұрын
WOW man that is flipping awesome. You are much smarter than I could ever hope to be. A sub from me my man! You have almost made eve online haha..im a fan
@Lampe2020
@Lampe2020 Жыл бұрын
Thanks a lot for this video! I hope I can use this knowledge to create my own Minecraft-inspired block game...
@RedstoneHair
@RedstoneHair Жыл бұрын
This is perfect, it's fast and not a lot is explained which is good, cause you'd expect the person to have some opengl knowledge to go as far as to 3D. Yet python also makes this very easy, I'm so glad I found this video, I've been wanting to make stuff like this
@sajagpradhanang8805
@sajagpradhanang8805 2 жыл бұрын
Thank You for this easy to follow and on-point tutorial.
@kapilshandilya903
@kapilshandilya903 2 жыл бұрын
Woot! Thank goodness, I needed this back on my computer! Thank you!! :D
@gianlucagiuman6132
@gianlucagiuman6132 2 жыл бұрын
WOW !! this IS the tutorial !! A really great teacher for what i like !!! Thanks
@aycatarakcoglu7539
@aycatarakcoglu7539 2 жыл бұрын
Take a week just learning the basics and you will be good, I been using soft soft since it was Fruity Loops back in 03, and still learn
@JacobKinsley
@JacobKinsley 2 жыл бұрын
I love how coding a rendering engine is just *8 years later* oh my god! I made a blue square! *10 seconds later* now I'm rendering a full city!
@bedirhanyelkovanc5422
@bedirhanyelkovanc5422 2 жыл бұрын
year for all of us, for so- it's still ongoing. i respect you for being honest as that's what's been keeping a bit sane recently, just being
@mythicalwhalers
@mythicalwhalers 2 жыл бұрын
This is a fantastic tutorial. Hope to see more of these!
@koufdell
@koufdell 2 жыл бұрын
this is gold , thx for the top G content :)
@yunusemrekaraman5294
@yunusemrekaraman5294 2 жыл бұрын
I'm a rapper who can't really afford production so I want to learn to make my own soft. I just want to say that I appreciate your teacNice tutorialng
@robertwhite8194
@robertwhite8194 5 ай бұрын
I’m glad I just took linear algebra, but this was pushing my limits.
@sakalagamingyt3563
@sakalagamingyt3563 2 жыл бұрын
This guy is seriously a great genius
@Anomalous-ye3hi
@Anomalous-ye3hi Жыл бұрын
Damn… thanks!! Best tutorial ever!
@jackl8545
@jackl8545 2 жыл бұрын
thank you soo much very direct link n works for me love the way you expressed the installation .
@hippiedonut1
@hippiedonut1 Жыл бұрын
Thanks!
@CoderSpaceChannel
@CoderSpaceChannel Жыл бұрын
Thank you too!
@M4DST4N
@M4DST4N 2 жыл бұрын
That's a great video! Thank you very much!
@gfhtyty
@gfhtyty 2 жыл бұрын
Damn thanks I really wanted to see how to make graphics engine and i really really wanted to make one myself thanks again
@ryanperks7747
@ryanperks7747 Жыл бұрын
Hey I’m having an issue at 12:48 where the colour of my cube is just black, any idea as of why?
@LeiffNathanAMendoza
@LeiffNathanAMendoza Жыл бұрын
TRUE CHARM INDEED ... AWESOME DETAILS AND CRITICAL STEPS ... KUDOS
@lavaa7392
@lavaa7392 2 жыл бұрын
This tutorial is amazing, but I'm getting stuck at 6:52. When I try to run the program at that point it says "FileNotFoundError: [Errno 2] No such file or directory: 'shaders/default.vert'" even though the file exists and is in the right spot in the folder. I checked and there are no typos. I don't know what happened.
@CoderSpaceChannel
@CoderSpaceChannel 2 жыл бұрын
the project code is available from the link in the video description, try it
@lavaa7392
@lavaa7392 2 жыл бұрын
Ok. I think I found the issue. I needed to have only the folder for the 3D engine open. If I have another directory open with that folder inside, it doesn't work. Thanks!
@embodythelogos
@embodythelogos Жыл бұрын
Hi! Is it ok to use the content I learn from your tutorial to develop an app for commercial use? I will write my own code but will use your code as template/reference since this is a tutorial. Do I have to give you an attribution for this (and how do I do that)? Thank you!!
@CoderSpaceChannel
@CoderSpaceChannel Жыл бұрын
If you will use the code from github, then just provide a link in the readme to the source code.
@engineetedAccel
@engineetedAccel Ай бұрын
DLL load failed while importing glm: The specified module could not be found pls help
@mostafaghobashy2724
@mostafaghobashy2724 Жыл бұрын
the vao means vertex attribute object while the ebo means element buffer object while the vbo means vertex buffer object
@zonea1826
@zonea1826 6 ай бұрын
Thai is next level python
@piponu
@piponu 2 жыл бұрын
Thank you very much for this great tutorial! Exactly what I was looking for. I am new to PyCharm and was wondering how/which color scheme you used to make your python code look so tidy? Greetz
@CoderSpaceChannel
@CoderSpaceChannel 2 жыл бұрын
monokai
@fester_lay
@fester_lay 2 жыл бұрын
@@CoderSpaceChannel Hello Coder Space. Why version PyGLM you using
@montsamu
@montsamu 4 ай бұрын
Interestingly, apparently it's a long-standing pygame bug for some PCs that you can't have BOTH event.set_grab True and mouse.set_visible True without things going haywire in a non-fullscreen window. So if anyone else has unexpected issues at that part (around 18:00) just comment out setting the mouse invisible.
@WalnutWarrior7
@WalnutWarrior7 12 күн бұрын
Thank you mr AI, very cool!
@kumu2024
@kumu2024 2 жыл бұрын
Best tutorial I have seen. A lot of information that you need to come back several times. While the code was written in front of me, I made several mistakes (colon rather than semicolon, typo ..etc).. I learned also that doing mistakes in the shader is not easy to debug. As a beginner in OpenGL I see this tutorial great. Can I ask what text-to-speach program you use please? Thank you very much for the time you put to produce this great content.
@CoderSpaceChannel
@CoderSpaceChannel 2 жыл бұрын
cloud.google.com/text-to-speech
@guidetoplantfibercordage3028
@guidetoplantfibercordage3028 Жыл бұрын
For some reason, the PyGLM module itself isn't working. Every time I try to install it, it errors. UPDATE: pyglm doesn't like python 3.12.0. use an earlier version.
@voytechj
@voytechj 2 жыл бұрын
If you define a texture with internal GL_SRGB8 format then you can get hardware auto conversion from sRGB to linear space and don't need power function in a fragment shader. I really don't know if this is possible in Moderngl? The last conversion (pow(1/gamma)) could be also avoided if Pygame supports creation of SRGB framebuffer. For example in FreeGLUT you can create window with GL_SRGB flag, and then call glEnable(GL_FRAMEBUFFER_SRGB) to get final auto conversion from linear to sRGB space for free. There is a good reason to have nonlinear displays and cameras. If you transfer pictures through medium (cable, air, etc.) you will always get extra noise attached to your signal. Our eyes have logarithmic response and are oversensitive to dark colours so noise is much more visible when light is very weak (dark faces, shadows, etc.). Pictures with nonuniform "noise damage" (perceptually concentrated in dark regions) looks bad so EE engineers designed cameras with x^(1/2.2) transfer function to boost dark colours that can survive noise attack during travel through space. Displays inverse that with x^2.2 function to bring back original relationship between colours. In the end noise is still on the picture but perceptually is spread across whole picture and final result is much more pleasant to human eyes, and they are wiling to pay money for such designed nonlinear systems. In digital systems 8-bit light intensity values are considered noisy and "bands" (quantization noise) are visible in dark colours just like in old analog systems. You need at least 12-bit for each red, green and blue value to have perfect picture without visible artefacts. But we like 8-bit because it's cheap, less bytes to transfer so it's fast, it also takes less space on SSDs. Because of that, we have nonlinear cameras and displays with gamma=2.2 just like in old analog systems.
@CoderSpaceChannel
@CoderSpaceChannel 2 жыл бұрын
valuable information, thanks 👍
@abacaabaca8131
@abacaabaca8131 Жыл бұрын
key concept when I missed is that the lookAt matrix will need to be recalculated when the user is pressing a key to move the camera with respect to the object position giving the illusion of the object is actually moving from the camera.
@abacaabaca8131
@abacaabaca8131 Жыл бұрын
what happen if we want the object to be moving instead of the camera ?
@rapidlemon906
@rapidlemon906 Жыл бұрын
You should talk in videos, it would feel more natural and engaging, luv your videos btw 👍
@sandywake3498
@sandywake3498 2 жыл бұрын
Hi. In the Transformation section of the video; in the 'get_model_matrix()' function, the 'self.pos' parameter in 'm_model = glm.translate(m_model, self.pos)' is marked as an unexpected argument by Pycharm and only a single cube is showing. What could be causing this?
@sandywake3498
@sandywake3498 2 жыл бұрын
Solved this, had the 'get_model_matrix()' function in both the BaseModel and the Cube class
@zenolth
@zenolth Жыл бұрын
I recommend using GLFW instead of Pygame and also give use to Index Buffers, othervise, good watch!
@AcceleratedVelocity
@AcceleratedVelocity Жыл бұрын
but pygame supports many functionalities, eg this code snippet def surf_to_texture(app, surf): tex = app.ctx.texture(surf.get_size(), 4) tex.filter = (moderngl.NEAREST, moderngl.NEAREST) tex.swizzle = 'BGRA' tex.write(surf.get_view('1')) return tex converts a pygame surface to a sampler2D texture to allow for 2d games in 3d ones, and its far simplet to use
@peach-w2k
@peach-w2k 3 ай бұрын
When i try to load models, some models are not showing up & some models only half are rendered, do you know where and how I could approach this issue? :((
@loan777
@loan777 Жыл бұрын
Thank you for this video, I learned a lot by playing with the code and I was able to create projects that I wanted to achieve. But I'd need some advice. I'm creating a physics engine and i'm struggling a lot with the spherical shapes like the icosphere or cylinders. I have written several scripts but none of them work. How would you proceed, in the way of this tutorial, to render sphericals object ? I had a great time watching all your videos. Thank you for all of them they are really usefull. Can't wait to see the next one !
@dominik4205
@dominik4205 2 жыл бұрын
I can't even get the triangle to show up.. only edit in code was winsize being at 1280, 720.
@dowlso
@dowlso 2 жыл бұрын
8:50 Error: module glm has not attribute perspective
@kaan_tuna
@kaan_tuna 2 жыл бұрын
Same here 😔
@Racengineer2
@Racengineer2 10 ай бұрын
All very cool and a much easier approach than I was taking. However, what would I have to do if I wanted to render a cube with 6 different textures or colours. Like a rubix cube. Would I have to split the cube into their own surfaces (6 cubes with thin walls) or is there a better/different way. I don't really want to split the cube in 6 since that will mean that if I wanted to move the cube I would have to move each instead of moving the whole cube.
@mingccode
@mingccode 3 ай бұрын
I need help! ModuleNotFoundError: No module named 'PyQt5.QtCore.QProcess'; 'PyQt5.QtCore' is not a package
@giusepperadatti225
@giusepperadatti225 Жыл бұрын
how do I ensure that when the camera touches the blocks there is a collision and the camera does not pass through them?
@quantumgamer6208
@quantumgamer6208 Жыл бұрын
Can you make a tutorial for how to make a 3D engine using vulkan
@ImPiton
@ImPiton Жыл бұрын
Добрый день. подскажи а как в посмотреть что там находиться?
@joshbarros1995
@joshbarros1995 Жыл бұрын
Your tutorials are amazing! Do you plan on creating a Quake Clone with Pygame?
@CoderSpaceChannel
@CoderSpaceChannel Жыл бұрын
I guess I will someday
@ImPiton
@ImPiton Жыл бұрын
Good afternoon. Please tell me how to find in your application what vertices it has in an object. That is, where is the vertex array located and how to view it. Thanks in advance)
@MrNunchackus
@MrNunchackus Жыл бұрын
Great video! Is it possible to improve this project for ray tracing, defining recursiveness of tracing and so on?
@dawna2011
@dawna2011 7 ай бұрын
even though I installed all requirement modules, I still have errors message. It is modernGL (mgl) no attribute to vec3. Why?
@goose2574
@goose2574 2 жыл бұрын
on the first run at 2:50 i got the error "Requested OpenGL version 330, got version 310"
@CoderSpaceChannel
@CoderSpaceChannel 2 жыл бұрын
It looks like your hardware or driver does not support OpenGL version 3.3 What is your hardware?
@zhabiboss
@zhabiboss 2 жыл бұрын
@Coder Space When I try to execute the file it just gives me a segmentation fault when it creates a context
@diandradeeke
@diandradeeke 10 ай бұрын
hello, i have problems with the glm-module. for some reason it is marked as malware by my anti virus program. So i cant compile the code, simply because it cant import the glm-module. What am i supposed to do?
@JohannaWagne
@JohannaWagne 10 ай бұрын
Hi! I have followed your tutorial in order to create a 3D engine and I have been trying to implement a terrain instead of the boxes. I have a height map (512x512) where the grey color corresponds to the height. I want to use this height map to build the terrain/ground of the 3D world. Do you have any tips on how to do this? Would be really helpful :)
@mgames3209
@mgames3209 6 күн бұрын
I have a cube that isnt rendering anything with the lighting. if anyone asks for my code or has ideas why please tel
@dipanmondal3664
@dipanmondal3664 Жыл бұрын
I have successfully installed PyGLM in my python but when i am trying to run my code it shows error. : module 'glm' has no attribute 'vec3'
@esraasabbagh5018
@esraasabbagh5018 2 жыл бұрын
Very helpful..thanks a lot.
@maxcartoon23
@maxcartoon23 Жыл бұрын
ummmm hey. about the GLSL Shader. How do i put it? i am on Visual Code Studio
@maxcartoon23
@maxcartoon23 Жыл бұрын
do i need to install it or how.
@Nikola95inYT
@Nikola95inYT Жыл бұрын
it's just the name of programming language. Languages themselves cannot be installed, they can be learned.
@yahyabeysami101
@yahyabeysami101 2 жыл бұрын
I don't understand the way to describe verticies. Is there more ressources on this topic ?
@kaan_tuna
@kaan_tuna 2 жыл бұрын
At 8:30 it says that glm has no attribute perspective?
@CoderSpaceChannel
@CoderSpaceChannel 2 жыл бұрын
check that you have installed the correct glm: pip install PyGLM
@kaan_tuna
@kaan_tuna 2 жыл бұрын
@@CoderSpaceChannel İ did that too, doing it again now it says requirements already satisfied
@CoderSpaceChannel
@CoderSpaceChannel 2 жыл бұрын
you can email me
@kaan_tuna
@kaan_tuna 2 жыл бұрын
@@CoderSpaceChannel what's your email?
@CoderSpaceChannel
@CoderSpaceChannel 2 жыл бұрын
email in the section - about the channel
@lachlanjohn8223
@lachlanjohn8223 Жыл бұрын
HI! im new to OpenGL and pygame, but at 5:01 i keep getting an error, i have tried downloading the code, still dosnt work. this is what dosnt work "program = self.ctx.program(vertex_shader=vertex_shader, fragment_shader=fragment_shader)" im not sure why... sorry for disturbing you Edit: OMG I GOT IT WORKING THANK YOU X
@brent9129
@brent9129 Жыл бұрын
Great tutorial! I'm fairly new to programming. I've implemented color picking to this so far and have been stuck on trying to understand how to move the cat individually. Reassigning the position does not work, but would be optimal. I'm wondering if it's possible, or there is a better way?
@robinhorneman2245
@robinhorneman2245 2 жыл бұрын
I still get those irritating white lines after applying mipmaps and the isotropic filter. Any clue as to why? The mipmap made it a little better but they are still clear as day.
@Titouan_Jaussan
@Titouan_Jaussan 11 ай бұрын
Hmmm, Why do I have the background color but not the rest ? I verified my code and the only potential problem that I can see is that I cant use version 330 OpenGl So I use version 310 in the GraphicsEngine class context but It still works if i set the version to 330 in the shaders
@manuelkarner8746
@manuelkarner8746 11 ай бұрын
if i want to animate a 3d model, would the engine be powerful enough for a naive approach where i just have a sequence of obj files for the animation and load them in fast ? or is there a better way? awsome video btw
@CoderSpaceChannel
@CoderSpaceChannel 11 ай бұрын
try assimp library
@manuelkarner8746
@manuelkarner8746 11 ай бұрын
@@CoderSpaceChannel wow thanks for the fast reply, I will definitely give it a try. I want to use it within your voxel engine :)
@beynertv7276
@beynertv7276 Ай бұрын
How not to draw sides that we can't see?
@beynertv7276
@beynertv7276 Ай бұрын
help pls
@nicolassuarez2933
@nicolassuarez2933 7 ай бұрын
Outstanding! But we realy need to export and load out of the box any .fbx, .gltf or .obj, any update? Thanks!
@CoderSpaceChannel
@CoderSpaceChannel 7 ай бұрын
assimp library
@nicolassuarez2933
@nicolassuarez2933 7 ай бұрын
@@CoderSpaceChannel Ok, I know assimp for c++, but there are no simple explanation regarding Python, any tip or link? Thanks!
@CoderSpaceChannel
@CoderSpaceChannel 7 ай бұрын
@@nicolassuarez2933 pypi.org/project/assimp-py/ pypi.org/project/pyassimp/
@nicolassuarez2933
@nicolassuarez2933 7 ай бұрын
@@CoderSpaceChannel Should I build assimp with Cmake and put the dll in python direcotory? pyassimp is not working, or I dont undertand how to use it...
@rizu1444
@rizu1444 2 жыл бұрын
i followed all these steps but when you are using sample that you have imported the program just bugs up.
@lumeras115
@lumeras115 Жыл бұрын
I'm getting an error saying "Triangle() takes no arguments"
@Hekysei
@Hekysei Жыл бұрын
how i can draw HUD using pygame in this project?
@KJ7JHN
@KJ7JHN 6 ай бұрын
What cpu was this run on? Arm? Pentium? Thanks. Oh, and how much memory?
@r4ndom-here
@r4ndom-here 11 ай бұрын
I can't add a GLSL file at 4:30
@pedroperdor4183
@pedroperdor4183 2 жыл бұрын
the headphones plugged in but the soft still cos though the computer speakers . It really should be because bluetooth has a delay
@TheRealWinsletFan
@TheRealWinsletFan 11 ай бұрын
Cool tutorial, but I must say I'm quite unhappy with the performance; it runs like an absolute dog on my 2019 iMac with 3.6GHz i9 and 580X Radio Pro. Obviously the hardware is not weak for a scene like this, what is the primary bottleneck?
@abacaabaca8131
@abacaabaca8131 Жыл бұрын
@10:51 we can use pygame.time.get_ticks()*0.001 to get the time in second, and then store that value as a field/attribute of the class GraphicsEngine. Next time we want to move an object we must move with respect to the elapsedtime, this way we do not need to limit our framerate using the Clock object. imagine if we want to move an object 30 unit or pixels per unit of time (maybe second) to the right in x-axis, class GameEngine: def __init__(self): self.elapsedTime=0 while True: //capture the elapsed time between previous frame and the current frame self.elapsedTime=pg.time.get_ticks()*0.001 velocity=glm.vec3(30,0,0) pos=glm.vec3(0,0,0) pos.x+=velocity.x*elapsedTime
@rayangamedev1912
@rayangamedev1912 2 жыл бұрын
bro i got a problem, in my model.py file i have right all code correct but it's give me an error, the error is such a file or directory not found: shaders/{shader_name}.vert, help plz
@Kantdhx
@Kantdhx 2 жыл бұрын
I'm facing the same problem but my mistake was that the shader files were not in the shaders file/directory it's simple
@rayangamedev1912
@rayangamedev1912 2 жыл бұрын
@@Kantdhx Bro thanks for help🙂
@Kantdhx
@Kantdhx 2 жыл бұрын
please, bro =) 😉
@Wasilij1337
@Wasilij1337 2 жыл бұрын
hi, i made everything good but i still gets error wherein program can't understand GraphicsEngine() in app = GraphicsEngine() pls help
@Wasilij1337
@Wasilij1337 2 жыл бұрын
CODE: import pygame as pg import moderngl as mgl import sys class GraphicsEngine: def __init__(self, win_size=(1600, 900)): pg.init() self.WIN_SIZE = win_size pg.display.gl_get_attribute(pg.GL_CONTEXT_MAJOR_VERSION, 3) pg.display.gl_get_attribute(pg.GL_CONTEXT_MINOR_VERSION, 3) pg.display.gl_get_attribute(pg.GL_CONTEXT_PROFILE_MASK, pg.GL_CONTEXT_PROFILE_CORE) pg.display.set_mode(self.WIN_SIZE, flags=pg.OPENGL | pg.DOUBLEBUF) self.ctx = mgl.create_context() self.clock = pg.time.Clock() def check_events(self): for event in pg.event.get(): if event.type == pg.QUIT or (event.type == pg.KEYDOWN and event.key == pg.K_ESCAPE): pg.quit() sys.exit() def render(self): self.ctx.clear(color=(0.08, 0.16, 0.18)) pg.display.flip() def run(self): while True: self.check_events() self.render() self.clock.tick(60) if __name__ == '__main__': app = GraphicsEngine() app.run()
@CoderSpaceChannel
@CoderSpaceChannel 2 жыл бұрын
import pygame as pg import moderngl as mgl import sys class GraphicsEngine: def __init__(self, win_size=(1600, 900)): pg.init() self.WIN_SIZE = win_size pg.display.gl_set_attribute(pg.GL_CONTEXT_MAJOR_VERSION, 3) pg.display.gl_set_attribute(pg.GL_CONTEXT_MINOR_VERSION, 3) pg.display.gl_set_attribute(pg.GL_CONTEXT_PROFILE_MASK, pg.GL_CONTEXT_PROFILE_CORE) pg.display.set_mode(self.WIN_SIZE, flags=pg.OPENGL | pg.DOUBLEBUF) self.ctx = mgl.create_context() self.clock = pg.time.Clock() def check_events(self): for event in pg.event.get(): if event.type == pg.QUIT or (event.type == pg.KEYDOWN and event.key == pg.K_ESCAPE): pg.quit() sys.exit() def render(self): self.ctx.clear(color=(0.08, 0.16, 0.18)) pg.display.flip() def run(self): while True: self.check_events() self.render() self.clock.tick(60) if __name__ == '__main__': app = GraphicsEngine() app.run()
@sonicfan88321
@sonicfan88321 Жыл бұрын
I don't know if anyone else is having this problem, but when I tried to add multiple cubes to the scene (after following the video to completion), I only ever saw the last cube added to the list of objects in the scene class.
@lkjh161
@lkjh161 9 ай бұрын
me too.
3D Engine in Python. SkyBox, Environment Mapping
9:03
Coder Space
Рет қаралды 29 М.
Let's Program Doom - Part 1
25:13
3DSage
Рет қаралды 477 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
I made Games with Python for 10 Years...
28:52
DaFluffyPotato
Рет қаралды 395 М.
The Math behind (most) 3D games - Perspective Projection
13:20
Brendan Galea
Рет қаралды 444 М.
The Beauty of Prime Numbers
10:54
Coder Space
Рет қаралды 45 М.
Pygame's Performance - What You Need to Know
9:11
DaFluffyPotato
Рет қаралды 213 М.
I Beat Minecraft From One Grass Block
35:27
Beppo
Рет қаралды 7 МЛН
When Optimisations Work, But for the Wrong Reasons
22:19
SimonDev
Рет қаралды 1,2 МЛН
From CPU to GPU: Understanding Data Transfer with Buffers in OpenGL
15:41
Luke's Dev Tutorials
Рет қаралды 9 М.
A simple procedural animation technique
8:31
argonaut
Рет қаралды 566 М.
2 YEARS of PYTHON Game Development in 5 Minutes!
4:54
Coding With Russ
Рет қаралды 1 МЛН