Yuta A.
Yuta A.
  • Видео 1
  • Просмотров 37 870
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...
Просмотров: 37 876

Видео

Комментарии

  • @yutaa.1904
    @yutaa.1904 2 месяца назад

    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

  • @john5449
    @john5449 2 месяца назад

    could you please do a 200 subscribers video?

  • @kelpR
    @kelpR 2 месяца назад

    genuinely one of the best tutorials ever thanks!

  • @cosjfwhaaksemfwk
    @cosjfwhaaksemfwk 3 месяца назад

    from korea, thank you soooo much!!!

  • @danhadland7087
    @danhadland7087 4 месяца назад

    Finally understood matrices after this thank you

  • @konradLarsson
    @konradLarsson 5 месяцев назад

    this is really good thanks

  • @hakankosebas2085
    @hakankosebas2085 6 месяцев назад

    loved it

  • @oussamafqihberrada5111
    @oussamafqihberrada5111 7 месяцев назад

    Thank you, stranger on the internet!

  • @spacex6997
    @spacex6997 7 месяцев назад

    Very clear explanation. Very nice.

  • @xlabc
    @xlabc 11 месяцев назад

    Incredibly useful 👍

  • @demaroaizenofe5694
    @demaroaizenofe5694 Год назад

    Voice Too Low

  • @vigzihaman5205
    @vigzihaman5205 Год назад

    how can i see the position of the corner the cube in the same window

  • @megauti
    @megauti Год назад

    You are great!

  • @BeBetter_-_
    @BeBetter_-_ Год назад

    me looking for hours finds this video and expirences joy

  • @1979zeesh
    @1979zeesh Год назад

    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

  • @dynast7550
    @dynast7550 Год назад

    how can i rotate cube based on mouse position

  • @leobozkir5425
    @leobozkir5425 Год назад

    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.

  • @davedave3631
    @davedave3631 Год назад

    Code Window was too zoomed out to see clearly. Did you expect people to be able to see what you’re typing?

  • @archyt88
    @archyt88 Год назад

    This is amazing video with great explanation math behind it, which is really important to understand. Thank you

  • @pancake891
    @pancake891 Год назад

    Omg yes thank you so much!!

  • @jotdown2741
    @jotdown2741 2 года назад

    How to rotate an object about its centroid Or how to rotate based on a arbitrary point

  • @treechickens1232
    @treechickens1232 2 года назад

    This is so cool and really well made :)

  • @lpi6298
    @lpi6298 2 года назад

    just what I was looking for. Very clear explanation. This guy deserves more recognition

  • @LukeLane1984
    @LukeLane1984 2 года назад

    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!

  • @Saw-qv3bl
    @Saw-qv3bl 2 года назад

    AMAZING but maybe you could have explained rotation a little more.

  • @ravethefox
    @ravethefox 2 года назад

    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

    • @yutaa.1904
      @yutaa.1904 2 года назад

      Thanks for the heads up!

    • @ravethefox
      @ravethefox 2 года назад

      @@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.

    • @ravethefox
      @ravethefox 2 года назад

      @@yutaa.1904 Im not sure yet but i think ive been having optical illusions

  • @909crime
    @909crime 2 года назад

    Iv watched so many videos and this is the first one that I actually understood about 3d. Thank you seriously

  • @austineadah2843
    @austineadah2843 2 года назад

    Could you please do a video on gestener waves implementation in python?

  • @finsheard8862
    @finsheard8862 2 года назад

    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

    • @texrot9781
      @texrot9781 2 года назад

      did you solve it

    • @yutaa.1904
      @yutaa.1904 2 года назад

      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.

    • @penguinpersonplays7342
      @penguinpersonplays7342 2 года назад

      @@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

  • @TheSecretDev
    @TheSecretDev 2 года назад

    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

  • @rupeshkanth
    @rupeshkanth 2 года назад

    Awesome.. I hope you will cover Quatrnions some day..

  • @duqc
    @duqc 2 года назад

    Great video!

  • @nerdyturkey312
    @nerdyturkey312 2 года назад

    Cool 👍 Just subbed. I'm using pygame for dev tools and puzzles... When I get the time.

  • @Blinkers2007GameDev
    @Blinkers2007GameDev 3 года назад

    wow thank you your'e so awesome!!!!!! i've learnt a lot of you

  • @Blinkers2007GameDev
    @Blinkers2007GameDev 3 года назад

    17:09 experiment with frames to understand the projection better. I did that on 1 frame, and could understand what was going on.

  • @Blinkers2007GameDev
    @Blinkers2007GameDev 3 года назад

    33 degrees sheesh!

  • @Blinkers2007GameDev
    @Blinkers2007GameDev 3 года назад

    very useful video. Could you do one with OpenGL?

    • @culan_SCP
      @culan_SCP Год назад

      Its the same principle, just with the openGL code

  • @enricopassoni1
    @enricopassoni1 3 года назад

    Very clear. Next step how to fill the polygons of the cube with a solid color or texture please

  • @Phostings1
    @Phostings1 3 года назад

    Oh wow, what a journey! I really enjoyed this video! Thanks for helping me understand how pygame generates 3D objects!

    • @yutaa.1904
      @yutaa.1904 3 года назад

      Thank you! I'm glad you enjoyed :)