PocketMatrix forums

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

A whole slew of questions

Hey guys.. rather than making multiple posts, I have a bunch of questions to ask so here goes.

1) What fixed point format are you using? I'm assuming 16.16?

2) Is the elapsed time per frame is in milli-seconds? I'm trying to synchronize my object movement to the frame rate so ideally it would be:

object.x += velocity.x * nElapsedTime

but that doesn't quite work. It does in floating point space... but not quite fixed point. Haven't done much fixed point though so I gotta learn a few things.

3) Is the internal triangle/texture rasterizer written in assembler? I was wondering if there was any plans to make it faster because right now it doesn't seem adequate to do anything complex unless you have a beefy processer.

4) Any plans to port the engine to BREW?
Hi Cardinal,

I will answer your questions one by one:
1. In 3D, 20:12 fixed point is used. This precision is also used for rotation (a whole circle is a value between 0 and 4096).
2. The elapsed time is in milliseconds. When using fixed point, you need to have both the coordinates and velocity in fixed point. The elapsed time should stay as is.
3. The rasterizers are written in optimized c/c++. I've replied to your other topic about how it runs slowly on your Blackjack test device. I think it runs faster on your other test devices (for example, the Animate3D sample works relatively fast on a Nokia E60 with a 200Mhz processor and resolution of 352x416 pixels).
4. BREW is on our radar, however we can't give an estimate.
Zalo · 24 Jan 2008, 16:59 UTC — About fixed point
Hi, Edge

Hi have noticed something weird. You say that you are using 20.12 fixed point, so I guess your identity matrix is

4096 0 0 0
0 4096 0 0
0 0 4096 0
0 0 0 4096

this is exactly what I can see in the debuger. Now, what happen if I scale this matrix with (4096, 4096, 4096). I was expecting a multiplication by the identy matrix and so the matrix will be exactly the same. But this is what I get:

256 0 0 0
0 256 0 0
0 0 256 0
0 0 0 256

?¿ If instead of this operation I scale the matrix with (65536, 65536, 65536) it is then when I get the identity matrix:

Code:

mesh->Reset();
mesh->Scale(65536, 65536, 65356);


the matrix is
4096 0 0 0
0 4096 0 0
0 0 4096 0
0 0 0 4096


So... I guess you are using 16.16 fixed point for scalation, is that correct? Where can I see the fixed point units that you are using?
Hi Zalo,

You're right, matrixes are 20:12 fixed point and the parameters to scale are 16:16 fixed point. The EDGELIB documentation has been updated.
I have also noticed that even thought usin opengl ES this is the same

Code:
display->WorldRotate(-vrot.x, -vrot.y, -vrotz);


Code:
display->WorldRotate(-vrot.x, 0, 0);
display->WorldRotate(0, -vrot.y, 0);
display->WorldRotate(0, 0, -vrot.z);


Using edge internal render not. I think that there is a bug with the first one and it changes rotation order. Can you check it out?
Hi Zalo,

We're aware of this bug and a fix will be available in the next EDGELIB release. Thanks for the bug report :)
And I think it would be great if matrix is accesible in classEDisplay and E3DSurface as a public attribute of with a pair of set, get methods. I love matrix control when developing in 3d ;)