###========================================================================== ### 360=2PI Radians. 180=PI Radians 90=PI/2 Radians 45=PI/4 Radians 57.2958 ### ### For vertices use (x,y,z,1), which allows for scaling, rotation, and translation. ### For vectors use , which allows for scaling and rotation (but not translation). ###-------------------------------------------------------------------------- # # B = [[ cos(R), -sin(R)], // Rotation Matrix - 2D # [ sin(R), cos(R)]] # # # Rx = [[ 1 0 0 0], [x] [x'] # [ 0 cos(R) -sin(R) 0], * [y] = [y'] # [ 0 sin(R) cos(R) 0], [z] [z'] # [ 0 0 0 1]] [1] [1 ] # # Ry = [[ cos(R) 0 sin(R) 0], [x] [x'] # [ 0 1 0 0], * [y] = [y'] # [ -sin(R) 0 cos(R) 0], [z] [z'] # [ 0 0 0 1]] [1] [1 ] # # Rz = [[ cos(R) -sin(R) 0 0], [x] [x'] # [ sin(R) cos(R) 0 0], * [y] = [y'] # [ 0 0 1 0], [z] [z'] # [ 0 0 0 1]] [1] [1 ] # # # Scale = {[ Sx 0 0 0], [x] [x'] # [ 0 Sy 0 0], * [y] = [y'] # [ 0 0 Sz 0], [z] [z'] # [ 0 0 0 1]] [1] [1 ] # # Translate [[ 1 0 0 Tx], [x] [x'] # [ 0 1 0 Ty], * [y] = [y'] # [ 0 0 1 Tz], [z] [z'] # [ 0 0 0 1]] [1] [1 ] # # Xcol Ycol Zcol # Direction 0 yz xz xy # Shear = [[ 1 Syx Szx 0], [x] [x'] # [ Sxy 1 Szy 0], * [y] = [y'] # [ Sxz Syz 1 0], [z] [z'] # [ 0 0 0 1]] [1] [1 ] # # # Xcol Ycol Zcol # Plane -1 yz xz xy # Reflection = [[ -x 0 0 0], [x] [x'] # [ 0 -y 0 0], * [y] = [y'] # [ 0 0 -z 0], [z] [z'] # [ 0 0 0 1]] [1] [1 ] # # ---------------------------------------------------------------------- # # http://learnwebgl.brown37.net/transformations2/transformations_matrices.html # http://www.f-lohmueller.de/pov_tut/trans/trans_450e.htm # http://web.iitd.ac.in/~hegde/cad/lecture/L6_3dtrans.pdf # https://www.gatevidyalay.com/tag/3d-reflection-matrix/ # ###------------------------------------------------------------------------