[Papervision3D] [Papervision 3D] Some matrix/affine transform math.
peperg at gmail.com
Sat Dec 30 06:53:12 EST 2006
I've found my old maths notebook.
Put this into motion and it works :D
There is an Matrix class that implements some simple methods.
An AffineMatrix class which offers method 'transform(Vertex3D)'
and some useful methods like:
scaleMatrix(sx:Number, sy:Number, sz:Number)
skewYZMatrix(s1:Number,s2:Number) etc. which You can use for creating
simple transformation matrix.
MyMesh is some kind of example - it's a class extending Mesh (actually I
borrowed PaperPlane class)
Note that this method transforms vertices in place so it changes model
geometry. It's not a good solution, I'm not sure of it, but I think the
transformation matrix should be used with projecting matrix (while
projecting 3D into camera's 2D plane). Projection (is it a correct
English word for it?) isn't an affine transform, but it shoud work as
well. Let's see what will Carlos say.
in the test scene You can see skewing as an example.
if You find it useful - feel free. You'll probably have to change packages
and API a bit to fit it into Papervision3D.
It's AS2 but making it work in AS3 should be easy. It's just some math.
Maybe some optimization will be useful as well.
Tests and comments are welcome (I don't have too much time, so it's not
More information about the Papervision3D