M3APPLY

SmallBASIC syntax groups: 


Math command M3APPLY


10
20  M3APPLY m3×3, BYREF poly
30
Apply matrix to poly-line.


See examples


If there is insufficient information on this page and you wish learn more about M3APPLY, please send an email to smallbasic@gmail.com. You can help to improve information about M3APPLY by submitting an article using the comments link below. Note, an offline language reference text file is now avialable – see the Download section.

|  1  0  0|
|  0 -1  0| = reflection on x
|  0  0  1|

| -1  0  0|
|  0  1  0| = reflection on y
|  0  0  1|

3D-Graphics Matrices:

|  1  0  0 Tx|
|  0  1  0 Ty| = translation
|  0  0  1 Tz|
|  0  0  0  1|

| Sx  0  0  0|
|  0 Sy  0  0| = scaling
|  0  0 Sz  0|
|  0  0  0  1|

|  1  0  0  0|
|  0  c -s  0| = rotation on x
|  0  s  c  0|
|  0  0  0  1|

|  c  0  s  0|
|  0  1  0  0| = rotation on y
| -s  0  c  0|
|  0  0  0  1|

|  c -s  0  0|
|  s  c  0  0| = rotation on z
|  0  0  1  0|
|  0  0  0  1|

Any change to matrix will combined with its previous value.

DIM poly(24)
DIM M(2,2)
...
M3IDENT M
M3ROTATE M, pi/2, 0, 0
M3SCALE M, 0, 0, 1.24, 1.24
...
' Draw the original polyline
DRAWPOLY poly
...
' Draw the polyline
' rotated by pi/2 from 0,0 and scaled by 1.24
M3APPLY M, poly
DRAWPOLY poly