MatrixAway3D forward up right

3 views
Skip to first unread message

John Brookes

unread,
Aug 25, 2010, 5:46:05 AM8/25/10
to away3d-dev
Shouldn't these be column vectors, not row?

eg
/**
* Returns a Number3D representing the forward vector of this matrix.
*/
public function get forward():Number3D
{
    _forward.x = sxz; //szx;  wrong?
    _forward.y = syz; //szy;  wrong?
    _forward.z = szz;
    return _forward;
}

John Brookes

unread,
Aug 26, 2010, 6:30:17 AM8/26/10
to away3d-dev
Yes no?
Talking out of wrong hole?

Stephen Hopkins

unread,
Sep 1, 2010, 3:37:59 AM9/1/10
to Away3D.dev
Hm. I have a similar problem with forward. Shouldnt doing this give
you essentially the same thing?

var direction:Number3D = new Number3D(0, 0, 1);
transform.multiply(direction);

transform.forward should have the same values as direction, no?

When I trace the values, the sign is flipped for x/y, or they are both
different, but the z remains the same in both Number3D's. Maybe there
is a problem like the original poster said, as the zz value is the
only one correct.

Rob Bateman

unread,
Sep 4, 2010, 7:19:50 PM9/4/10
to away3...@googlegroups.com
John: I'm afraid that the notation there is written as S: row : column. just to be extra confusing. ;)

Stephen: I'm afraid i don't follow you example code - the multiply function should be used with two matrix arguments, outputting to the transform matrix object?

Rob
--
Rob Bateman
Flash Development & Consultancy

rob.b...@gmail.com
www.infiniteturtles.co.uk
www.away3d.com

John Brookes

unread,
Sep 5, 2010, 6:33:03 AM9/5/10
to away3...@googlegroups.com
Erm. still think its wrong.

Simple example a cube in the center of the screen with random rotation XYZ.
I should then be able to place an object in front of the cube like so.

cylinder.x = cube.transform.forward.x * 210;
cylinder.y = cube.transform.forward.y * 210;
cylinder.z = cube.transform.forward.z * 210;

But that wont work, because forward uses the row not column.

Little example,
http://www.shrewballooba.co.uk/blog/wp-content/uploads/2010/09/AWCamforward.swf
click n drag
The cylinder uses row,like the matrixAway3D class (szx,szy,szz)
The sphere uses column (sxz,syz,szz)

-R-|-U-|-F-|-T
sxx sxy sxz tx
syx syy syz ty
szx szy szz tz

Rob Bateman

unread,
Sep 9, 2010, 7:48:11 PM9/9/10
to away3...@googlegroups.com
Ah, i see what you mean now

code is updated in the trunk to the correct implementation

cheers

Rob
Reply all
Reply to author
Forward
0 new messages