Game Development Community

ShapeImage mountPoint rotation problems

by Manoel Neto · in Torque Game Engine · 08/19/2005 (2:16 pm) · 7 replies

Hi,

I'm adding a mountPoint node to items the players can carry in our game. The same DTS files are used both for shapeImages and staticShapes we use for displaying the items in game, so the player can pick them up (we don't use the item class since our items are picked in a much different way).

They work fine for making the items attach where we want to, but everything goes haywire when the shapeImage mountPoint contains rotation. I was trying to add rotation to it so we could re-use the same carry animation for several objects of the same size, but that must appear at different angles on the player's hand. But I just can't find a way to get the mountPoint rotation to work. The result is that the item on the player's hand will appear rotated around some other point, not around the mountPoint, and in a completly wrong angle.

I was trying to match the items rotation like this (I'm using Maya):

- Import the character (with the item holding animation) into my item file;
- Move the item model until it fits the character hand properly;
- Now I select the mount0 and make it a child of the item shape (preserving the world transform);
- Then I delete the character and reset the model shape transform;
- And I rename the mount0 to mountPoint, so it works in Torque.

I was expecting the mountPoint rotation to be applied to the shapeImage when mounted, thus making the image position match that one I got in Maya. But the result is totally weird. I at least expected the rotation to be inverse, but instead it rotates around another point (seems to rotate around the bounding box pivot point).

Is there a way to make a mountPoint rotation properly rotate the shapeImage? Or do I need to make different .DSQs for each item, with different mount0 rotations for each item?

#1
08/20/2005 (3:12 pm)
I believe (an artist can correct me on this!) that the pivot point is what is used for doing mount point "offsets." So that's what needs to be aligned to get things working properly.
#2
08/25/2005 (7:03 am)
The problem is that rotating the bounding box pivot point will make the model show up rotated when placed in the mission as a staticShape or item, what makes it a bit annoying to fix. But seems it's either that or exporting two versions of each model (one for hand and another for mission).
#3
08/25/2005 (8:20 am)
Don't adjust the bounds box, adjust the dummy mount node itself. If you are using Max select the mount node and click the 'hierarchy' tab, 'pivot' button, and then 'affect pivot only' button. Use the rotate gizmo to align the axis orientation appropriately.

This is briefly covered in the video tutorial from the link below:

torque.smdlabs.com/media/freeTutorials/maxdts/page1.htm

In the lower right corner of the Step 2 A-C screenshot you will see the buttons circled in red that allow you to adjust the dummy mount point nodes axis orientation.

Hope this helps.

B--
#4
08/26/2005 (9:02 am)
Ah, I see. So I don't rotate the mount node directly, instead, I rotate it's pivot point. I'll forward this to our artist and see if he can test that (we're using Maya, not MAX, but I'm sure there shouldn't be much problems).
#5
12/10/2007 (10:47 am)
We have the exact same problem that you had with mountPoint rotations, and I was wondering if you found a solution?

We are also using Maya, and I don't know of a way to rotate only the pivot point the way they described when using Max.

Any help would be greatly appreciated as this has driven us crazy trying to fix.
#6
12/10/2007 (2:57 pm)
It's been a while, but I "solved" the problem by giving in and reversing the whole thing. Don't rotate the shapeImage mountPoint and leave all rotations to the mount points in the player itself.

We found out another way to accurately position the mount points so the shapeImages show up correctly on the player:

- Import the shapeImage into the character;
- Move the shapeImage's pivot to it's mountPoint node;
- Make the shapeImage a child of the mount point it'll be attached to in-game;
- Zero all of the shapeImage's transforms;
- Now position the character's mount point until the object looks good;
- Save and export the character (the shapeImage needs no changes).

Also try to keep the shapeImage's mountNode as close as possible to the position where it'll be held by/attached to the character.
#7
12/10/2007 (4:21 pm)
Thanks much, Manoel ... we'll give you method a try. Our setup was similar, so I hope following your steps works well. We have tried to have the shapeImage's mountPoint not rotated (and its bounds pivot snapped to th mountPoint node), handling the rotation only on the player, but it didn't work. Actually, our mount0/mount1 nodes are in the right/left hands, respctively, but they are different than the example that comes with Torque. In their example, the players hands are in a gun-holding position, which makes the mount0 pivot without rotation. In our character, the mount0 is in his palm and he needs to carry items to the side, in front of him, and all around. The problem basically occurs when we blend a lower and upper body animation together. The objects will mount okay with only the lower animaton link (or on our 'base pose' model), but once we have the upperbody DSQ link, the rotation is off. Not sure why it does that.... thought the two DSQs were 'adding' rotations or something, but that isn't it (I don't think).

Any thoughts?