[libawd] Incorrect 4x3 identity matrix

Software: Away3D 4.x

Polymathic, Newbie
Posted: 25 March 2013 03:43 PM   Total Posts: 5

Hello,

When creating an AWDSceneBlock in libawd, the transform matrix is set by default to the 4x4 identity matrix (scene.cc line 17). When writing the scene to a file, only the first 12 elements are written, because it is supposed to be a 4x3 matrix (scene.cc line 45). The problem is, truncating the 4x4 identity matrix to the first 12 elements doesn’t make a 4x3 identity matrix, because the matrix is stored column by column and not line by line. The resulting 4x3 matrix is :

(1 0 0 0)
(
0 0 0 1)
(
0 1 0 0

This causes the scene block to have an incorrect transform matrix by default.

ps : there is also en error in the specification document, at the top of page 21 : the document states that the transform matrix is a 128 byte 4x4 matrix, but it is encoded de facto as a 48 byte 4x3 matrix.

Martin Bousquet

ps 2 : i know this is not the section to report bugs, but i don’t seem to find the section github about libawd…

   

CyrilM, Newbie
Posted: 08 April 2013 01:57 PM   Total Posts: 15   [ # 1 ]

I don’t know how away3D handles matrices but what if you the bytes are flipped the other way?

using the bytes in the following order

14710
2
5811
3
6912 

the matrix would become

1000
0
100
0
01

Just the last row that is missing, but if the position is stored in 4,1 4,2, and 4,3 then I don’t think that row is needed. I could be wrong though.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X