Game Development Community

DTS non uniform scaling not working

by Pete Patterson · in Game Design and Creative Issues · 03/17/2007 (6:26 am) · 1 replies

Hi...

I'm trying to animate a block and tackle going up and down, so I thought that animating the scale of the rope joining the top block to the bottom block would work given the appropriate heirarchy. If I only scale it in the Z dimension, it should look like it's just retracting in the vertical, and the thickness of the ropes and the distance between them should stay the same.

So basically I have a heirarchy like so:

root dummy object - > top block -> rope -> bottom block

The axis of the rope is positioned at the top of the rope, so the scaling should all occur toward the down side and the top of the rope should remain fixed.

It's working in a way... the bottom block with it's hook attached is moving up and down exactly as expected, but the rope joining the top and bottom isn't being scaled properly, which of course ruins the effect.

It's hard to describe exactly what it's doing, but it's definitely not scaling in one dimension the way that the movement of the lower block would imply. It seems to just be doing a uniform scale... I substituted a cube for the rope and the cube is growing in all three dimensions.

I'm using the Max DTS exporter. I do have the SEQ marker set to enable 'arbitrary scale animation' as well as transforms, and I have even tried forcing them. I've tried it with collapse transforms on and off, but I always get an animation where the block moves, but the rope scales incorrectly.

If anyone has gotten non uniform scaling working and can offer any tips on what the correct export settings should be, or the exact kind of scaling controller to use in Max, I'd appreciate it. If anyone has run into the same issue and just has additional symptoms to report, that would be helpful too.

#1
03/17/2007 (7:36 am)
Found the problem:

In ShapeMimic.cpp, in the ShapeMimic::animateAlignedScale function...

(code reformatted to get rid of long lines)

if ((mFabs(delta.x)>0.001f || mFabs(delta.y)>0.001f || mFabs(delta.z)>0.001f))
        {
            if(  
	mFabs(delta.x-delta.y)>0.001f && 
	mFabs(delta.y-delta.z)>0.001f &&
	mFabs(delta.z-delta.x)>0.001f)
               // we not only animate scale, but we do it non-uniformly
	{
                     return true;
	}
       }

should be changed to:

if ((mFabs(delta.x)>0.001f || mFabs(delta.y)>0.001f || mFabs(delta.z)>0.001f))
        {
            if(  
	mFabs(delta.x-delta.y)>0.001f || 
	mFabs(delta.y-delta.z)>0.001f || 
	mFabs(delta.z-delta.x)>0.001f)
               // we not only animate scale, but we do it non-uniformly
	{
                     return true;
	}
       }

Note that the AND chain was converted to an OR chain. If any of the axes scale differently from the others it should return TRUE, not if all of the axes are differently scaled.