Coding Challenge #112: 3D Rendering with Rotation and Projection

Subscribers:
1,740,000
Published on ● Video Link: https://www.youtube.com/watch?v=p4Iz0XJY-Qk



Duration: 34:02
171,165 views
4,477


Can I draw and rotate a 3D cube using Processing's 2D renderer with just some math?!?! Yes! Watch to learn more about rotation and projection matrices along with perspective and orthographic projection! Code: https://thecodingtrain.com/challenges/112-3d-rendering-with-rotation-and-projection

πŸ•ΉοΈ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/r8l8XXD2A

πŸŽ₯ Previous video: https://youtu.be/3noMeuufLZY?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ Next video: https://youtu.be/XE3YDVdQSPo?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH

References:
πŸ’Ύ Matrix Multiplication: http://matrixmultiplication.xyz
πŸ—„ Rotation Matrix on Wikipedia: https://en.wikipedia.org/wiki/Rotation_matrix
πŸ—„ 3D Projection on Wikipedia: https://en.wikipedia.org/wiki/3D_projection

Videos:
πŸš‚ Matrix Math: https://www.youtube.com/watch?v=uSzGdfdOoG8
πŸš‚ Matrix Multiplication for 3D Rendering: https://youtu.be/tzsgS19RRc8
πŸ”΄ Coding Train Live 148.1: https://youtu.be/v6EmLhu7C9M?t=3285s

Related Coding Challenges:
πŸš‚ #26 3D Supershapes: https://youtu.be/akM4wMZIBWg
πŸš‚ #113 4D Hypercube (aka 'Tesseract'): https://youtu.be/XE3YDVdQSPo
πŸš‚ #142 Rubik's Cube: https://youtu.be/9PGfL4t-uqE

Timestamps:
0:00 Introducing today's topic: 3D rendering in 2D
2:08 Let's begin coding!
7:50 Add a projection matrix
12:00 Add a rotation matrix
18:02 Make a cube with 8 points
20:41 Normalize the cube
21:45 Connect the edges
28:09 Add perspective projection
31:36 Conclusion and next steps

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

πŸš‚ Website: http://thecodingtrain.com/
πŸ‘Ύ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
🚩 Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
πŸ’‘ GitHub: https://github.com/CodingTrain
πŸ’¬ Discord: https://thecodingtrain.com/discord
πŸ’– Membership: http://youtube.com/thecodingtrain/join
πŸ›’ Store: https://standard.tv/codingtrain
πŸ–‹οΈ Twitter: https://twitter.com/thecodingtrain
πŸ“Έ Instagram: https://www.instagram.com/the.coding.train/

πŸŽ₯ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

πŸ”— p5.js: https://p5js.org
πŸ”— p5.js Web Editor: https://editor.p5js.org/
πŸ”— Processing: https://processing.org

πŸ“„ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new

#3drendering #projectionmatrix #perspectiveprojection #rotationmatrix #processing







Tags:
programming
daniel shiffman
tutorial
coding
the coding train
nature of code
processing
matrix math
matrix multiplication
math 3d rendering
math 3d
projection map
projection matrix
processing 3d
orthographic
orthographic projection
orthographic drawing
orthographic view
3d perspective
rotation matrix