- Видео 1
- Просмотров 37 870
Yuta A.
Добавлен 17 апр 2015
My name is Yuta and I enjoy coding and teaching.
3D Rotation & Projection using Python / Pygame
This video was inspired by pythonista's 3D projection video. Link is included in the references section below.
In this tutorial I go over the math behind 3d projection/rotation and write code to display the projection of a rotated cube onto a pygame window.
If you followed the tutorial fully, thank you! You can also try creating your own 3-D points by making a new list of 3-d coordinates and iterating through those points instead of the points in cube_points! (ex. try a pyramid shape!)
Source Code:
github.com/yuta5111/3DProjection
References:
technology.cpm.org/general/3dgraph/
en.wikipedia.org/wiki/Rotation_matrix
ruclips.net/video/qw0oY6Ld-L0/видео.html
Chapters:
0:00 Introduction
0:17 Projectio...
In this tutorial I go over the math behind 3d projection/rotation and write code to display the projection of a rotated cube onto a pygame window.
If you followed the tutorial fully, thank you! You can also try creating your own 3-D points by making a new list of 3-d coordinates and iterating through those points instead of the points in cube_points! (ex. try a pyramid shape!)
Source Code:
github.com/yuta5111/3DProjection
References:
technology.cpm.org/general/3dgraph/
en.wikipedia.org/wiki/Rotation_matrix
ruclips.net/video/qw0oY6Ld-L0/видео.html
Chapters:
0:00 Introduction
0:17 Projectio...
Просмотров: 37 876
Hi everyone, Thank you all for the kind comments. I see all of them and appreciate every one. I never expected this video to reach so many people. If I didnt' respond to your question, it unfortunately means I don't know the answer and I don't want to invest the time to figure out the answer - sorry. Although the space is still very fascinating, Game development/math is no longer my main topic of interest since I started web development professionally. I originally decided to make the 3D projection video because there weren't a lot of videos on RUclips explaining both the math and the code behind it. Although I'd be happy to upload videos on web development, there is already so much content out there that it feels redundant. That said, I'm pretty curious about your guys' main topic of interest so it would help a lot if you could leave a comment here on what kind of content you'd like to see, if any. Depending on whether my knowledge/interest and your guys' interests align or not, I'll try coming up with another video idea for the future. Thank you all again
could you please do a 200 subscribers video?
genuinely one of the best tutorials ever thanks!
from korea, thank you soooo much!!!
Finally understood matrices after this thank you
this is really good thanks
loved it
Thank you, stranger on the internet!
Very clear explanation. Very nice.
Incredibly useful 👍
Voice Too Low
how can i see the position of the corner the cube in the same window
You are great!
me looking for hours finds this video and expirences joy
This is awesome tutorial ive seen after a long time....i need some help: how i can modify the code to rotate this cube based on the values coming a accelerometer sensor? i get heading details from that sensor
how can i rotate cube based on mouse position
Great video! Just one correction for the newcomers: remove the key detection from the event loop and put it inside the main loop, so it doesn't depend on the amount of events coming in.
Code Window was too zoomed out to see clearly. Did you expect people to be able to see what you’re typing?
This is amazing video with great explanation math behind it, which is really important to understand. Thank you
Omg yes thank you so much!!
How to rotate an object about its centroid Or how to rotate based on a arbitrary point
This is so cool and really well made :)
just what I was looking for. Very clear explanation. This guy deserves more recognition
Good tutorial! Thanks! I was playing around with PyGame a little today, and I was wondering how to do something like this. I was already familiar with rotation matrices and matrix calculation in general, but wasn't sure how to actually code it in Python. This helped a lot! You, sir, have got yourself a subscriber!
AMAZING but maybe you could have explained rotation a little more.
I havent tested your code but its calculated in the same way as many other python tutorials which cover up a fatal flaw by using a cube. The issue is that in certain conditions the polarity of the value of the z axis flips in all points which is invisible on a cube
Thanks for the heads up!
@@yutaa.1904 ive just tested your code and it suffers from the same issue and from my testing its not the rotation matrices but something after that im not sure what though. i printed the coords for a single point after all the rotations have been made and even if it is flipped the z axis keeps its polarity so im completely stumped. i can only assume the projection matrix is wrong but idk.
@@yutaa.1904 Im not sure yet but i think ive been having optical illusions
Iv watched so many videos and this is the first one that I actually understood about 3d. Thank you seriously
Could you please do a video on gestener waves implementation in python?
i keep getting the error 'object of type 'int' has no len()' for the variable b_rows = len(b). please could you explain how to fix that
did you solve it
Try and debug the line where you are calling the multiply_m function (specifically, the second argument that you are passing in). You should be passing in a 2d list, not an integer.
@@yutaa.1904 I got the same error and the issue is when drawing the points "point[0]" is an int so you are incorrect... I think, correct me if i'm wrong
The Time I spent trying to find a video like this that explains the maths behind it! EDIT: You need more subs this is AMASING
Awesome.. I hope you will cover Quatrnions some day..
Great video!
Cool 👍 Just subbed. I'm using pygame for dev tools and puzzles... When I get the time.
wow thank you your'e so awesome!!!!!! i've learnt a lot of you
17:09 experiment with frames to understand the projection better. I did that on 1 frame, and could understand what was going on.
33 degrees sheesh!
very useful video. Could you do one with OpenGL?
Its the same principle, just with the openGL code
Very clear. Next step how to fill the polygons of the cube with a solid color or texture please
Oh wow, what a journey! I really enjoyed this video! Thanks for helping me understand how pygame generates 3D objects!
Thank you! I'm glad you enjoyed :)