Hi,

I've got a problem with a matrix. I tried to create it out of three 
orthogonal vectors (x, y and z) and a point (from). Everything seems to 
work, but when I run the program, the last position (avatarmatrix 
[3][3]) was always set to "0". "at" and "from" are Pnt3f.

         Vec3f z = at - from;
         Vec3f x = z.cross(up);
         Vec3f y = x.cross(z);
         x.normalize();
         y.normalize();
         z.normalize();
         
         Vec4f v1 = Vec4f(x[0], x[1], x[2], 0.0);   
         Vec4f v2 = Vec4f(y[0], y[1], y[2], 0.0);
         Vec4f v3 = Vec4f(z[0], z[1], z[2], 0.0);
         Vec4f v4 = Vec4f(from[0], from[1], from[2], 1.0);      
         
         Matrix avatarmatrix;
         avatarmatrix.setIdentity();
         avatarmatrix = Matrix(v1, v2, v3, v4);

         // workaround
         avatarmatrix[3][3] = 1.0f;

Does anybody know about this problem ?

Regards,
Sandra

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to