PocketMatrix forums

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

E3DSurface » Rotate, Scale

void Rotate(long xr, long yr, long zr)
Rotate the model over the given axis. A value between 0 and 4096 represents a whole circle.

I am not understand why it is 4096, why not 0-2pi


void Scale(long xz, long yz, long zz)
Scale the model over the given axis. Values bigger than 65536 make the model larger while values smaller than 65536 make the model smaller.

Also how to gain the value 65536?

Thanks.
Hi Gar,

A circle is a number between 0 and 4096 because EDGELIB uses fixed point (and uses no decimal numbers). To increase precision we've increased the number to 4096. This number also has the advantage that you can efficiently calculate with it using optimized functions. These are the same values used by the Sin and Cos functions of ClassEMath.

Here is an example to scale your model 200%:

Code:

surface.Scale(65536 * 2, 65536 * 2, 65536 * 2);