Game Development Community

Scaling a shapebaseimage

by Ian Omroth Hardingham · in Torque Game Engine · 09/01/2005 (5:50 am) · 3 replies

Hey everyone.

I can't find any way to scale a shapebaseimagedata for mounting. Is this simply a feature not supported?

thanks,
Ian

#1
09/01/2005 (6:10 am)
Rescale the model
#2
09/01/2005 (6:26 am)
Ah, I didn't realise it would be as easy as adding a scale member to shapeBaseImageData and:

// new code
      glScalef(image.dataBlock->scale.x, image.dataBlock->scale.y, image.dataBlock->scale.z);
     // end of new code

      image.shapeInstance->setupFog(fogAmount,state->getFogColor());
      //image.shapeInstance->animate();
      image.shapeInstance->render();

      // easiest just to shut it off here.  If we're cloaked on the next frame,
      //  we don't want envmaps...
      image.shapeInstance->setEnvironmentMapOn(false, 1.0);

Nice :) Thanks Anthony.

Ian
#3
03/14/2007 (4:41 pm)
I tried adding a Point3F scale member to struct ShapeBaseImageData: public GameBaseData {} and added the "glScalef()" in the function ShapeBase::renderMountedImage(). Is this the correct place to do it and does this work in TGE 1.5?

--edit--

AH! To get this to work, I added in Player::renderMountedImage()
glScalef(image.dataBlock->scale.x, image.dataBlock->scale.y, image.dataBlock->scale.z);