PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

E3DSurface. Scale () function?

Hi,
I'm having some issues while scaling a loaded model. Could anyone please explain how the Scale method works and what the parameters correspond to?

For instance, if I want to scale the object size by half, how would I do that?

Thanks!
Hi CountZero,

If you only need to scale the model at loading time, you can use the modelsize parameter of CreateSurface(). Set it to -1 to half the size, or -2 for 1/4 size.

If you need to scale the model runtime, you can use E3DSurface :: Scale. To have a 50% size model on each axis, use 32768 for all parameter values. 65536 is 100% size, 65536 / 2 is half size and 65536 * 2 is double size. When scaling each frame, don't forget to call E3DSurface :: Reset (or else it will shrink very quickly).