Game Development Community

Rotating mounted images?

by Robert Brower · in Torque Game Engine · 09/28/2004 (2:38 am) · 0 replies

I'm working on a vehicle that can pick up objects with an animated claw. When they are picked up I am deleting the object and mounting an image to the claw. I would like to overload renderMountedImage() and use this to rotate the mounted image relative to the deleted object's transform and mount point transform in the claw at the time the image was mounted... but I am having trouble.

Just before the object is deleted and I mount an image of the object I do this:

MatrixF mat;
mat.mul(mShapeInstance->mNodeTransforms[mDataBlock->clawMountPoint], pObj->getTransform());
AngAxisF aa(mat);
mMountedImageAngle = aa;


then mMountedImageAngle is sent to the client. If you look in player.cc where renderMountedImage() is overloaded you will see glTranslatef(displace.x, displace.y, displace.z); Instead of doing this I am doing:

Point4F p(mMountedImageAngle.axis.x, mMountedImageAngle.axis.y, mMountedImageAngle.axis.z, mMountedImageAngle.angle);
MatrixF tmat;
tmat.mul(p);
AngAxisF aa(tmat);
glRotatef(aa.angle, aa.axis.x, aa.axis.y, aa.axis.z);

But this doesn't rotate the image at all, it merely translates it. I've tried dozens of ways to do this. Does anyone know where i am going wrong?

Thank you,

Robert