Can SetMatElement() be used to skew a mesh?

Blitz3D Forums/Blitz3D Programming/Can SetMatElement() be used to skew a mesh?

JoshK(Posted 2004) [#1]
Can SetMatElement() be used to skew a mesh without altering vertex coordinates?


Floyd(Posted 2004) [#2]
The answer should be yes, assuming you have a SetMatElement function.

For example, this is a very simple skewing function:

( x, y, z ) --> ( x, x+y, z )

As usual, the point (x,y,z) will be represented by the 4-d value (x,y,z,1).

And the transformation matrix would look like this:
1 1 0 0
0 1 0 0
0 0 1 0
0 0 0 1


This assumes the usual Blitz/Direct3D left-handed system.
That means doing vector*matrix, where the vector is a row.

In OpenGL, or tradional math, the right-handed system forces
the calculation to be matrix*vector, and the vector is a column.
In that case the matrix is the transpose of the one I gave
i.e. the new columns are the rows of the original matrix.


JoshK(Posted 2004) [#3]
Well, yeah, but I am wondering if Blitz3D will allow it.