Understanding the Transform3d

hi,

do you guys know good tutorials for understanding the matrix used by Transform3D?

I know how to move or rotate an object, but I dont know how to turn an object so that it looks at the direction of another object. There I want to understand the math now.

thanx,

Usul

p.s.
and I DID google for hours, I swear. But either the sites only talk about very basic stuff or they are very complicated. I didnt find anything in between.

OK, I drawed the matrix on my HUD and now Im starting to understand. Its obvious where the position is stored and I guess I can figur that rotation thing out by myself.

But what is the last colum of that Matrix4d used for? Its always (0,0,0,1).

Still I would appreciate any good tutorials on that subject.

Edit: The big question is: How can I determine from that Matrix4d in which direction (in angles to the axis) I am facing?

Edit: A maybe simpler answer would suffice: How can I get the direction (represented as a quaternion or a matrix) between to points/vectors?

See Transform3D.lookAt()

The matrix is a standard 4x4 vector transform matrix. Look at your favorite Vector Algebra book or any basic 3D graphics book (eg Foley and Van Damme)

I tried it. I wanted my modol to look at the origin (without changing its position) every time I press a button. But it just jumps around (at least the up-vector seems to work). Here’s my code:


        //GET CURRENT POSITION
        tg.getTransform(transform3D);
        Vector3d pos = new Vector3d();
        transform3D.get(pos);
        System.out.println(pos.x +" " + pos.y+" "+pos.z);
        //LOOK AT THE ORIGIN 
        transform3D = new Transform3D();
        transform3D.lookAt(new Point3d(pos.x,pos.y,pos.z),new Point3d(0,0,0), new Vector3d(0,1,0));
        tg.setTransform(transform3D);

Edit: Oh wait, it DOES work. I just forgot that I didnt place my cube3d in the origin (in other words: stupid mistake). OK, thanx.