esp is "shaking"

Posts 1–3 of 3 · Page 1 of 1
esp is "shaking"
>>

Can someone explain me what I do wrong?
Bad viewMatrix offset? or WorldToScreen func?
I've heard something about flicker free offset but Idk if it's that.
09.10 viewMatrix = 0x4A9D564

Code:
                GET VIEWMATRIX:

                float[] tmp = new float[16];

                for (int i = 0; i < 16; i++)
                {
                    var fixedAddress = ADDRESS_VIEWMATRIX + (i*0x4);

                    var viewMatrixAddress = BASE_CLIENT + "+0x" + fixedAddress.ToString("X8");
                    tmp[i] = m.readFloat(viewMatrixAddress);
                }

                viewMatrix = new Matrix4x4(
                    tmp[0], tmp[1], tmp[2], tmp[3],
                    tmp[4], tmp[5], tmp[6], tmp[7],
                    tmp[8], tmp[9], tmp[10], tmp[11],
                    tmp[12], tmp[13], tmp[14], tmp[15]);
Code:
            WORLD2SCREEN (copy&paste):

            Vector3 temp = new Vector3();

            temp.Z = 0f;

            temp.X = viewMatrix.M11 * world.X + viewMatrix.M12 * world.Y + viewMatrix.M13 * world.Z + viewMatrix.M14;
            temp.Y = viewMatrix.M21 * world.X + viewMatrix.M22 * world.Y + viewMatrix.M23 * world.Z + viewMatrix.M24;
            temp.Z = viewMatrix.M31 * world.X + viewMatrix.M32 * world.Y + viewMatrix.M33 * world.Z + viewMatrix.M34;

            if (temp.Z < 0.01f)
            {
                return new Vector2() { X = -1f, Y = -1f };
            }

            var invw = 1.0f / temp.Z;
            temp.X *= invw;
            temp.Y *= invw;

            var width = (float)SystemParameters.PrimaryScreenWidth;
            var height = (float)SystemParameters.PrimaryScreenHeight;

            var x = width / 2f;
            var y = height / 2f;

            x += 0.5f * temp.X * width + 0.5f;
            y -= 0.5f * temp.Y * height + 0.5f;

            temp.X = x;
            temp.Y = y;

            return new Vector2() { X = temp.X, Y = temp.Y };
Solved.
The problem was in for loop.
The value was changing while reading it.
Now i read matrix at one go.
Has been solved.

/Closed.
Posts 1–3 of 3 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us