Ye, osbot's api is f closed source but that doesnt mean i can't decompile it and release.
public static short[][] getScreenCoordinates(Client client, int gridX, int gridY, int gridZ, Model model) {
int cameraX = client.getCameraX();
int cameraY = client.getCameraY();
int cameraZ = client.getCameraZ();
int sinP = Utilities.CAMERA_SIN[client.getCameraPitch()];
int cosP = Utilities.CAMERA_COS[client.getCameraPitch()];
int sinY = Utilities.CAMERA_SIN[client.getCameraYaw()];
int cosY = Utilities.CAMERA_COS[client.getCameraYaw()];
if (model.getTriangleCount() < 0) {
return new short[0][];
}
short[][] screenCoords = new short[model.getVerticeCount()][];
for (int n = 0; n < model.getVerticeCount(); n++) {
int x0 = model.getVerticesX()[n] + gridX;
int z0 = model.getVerticesZ()[n] + gridY;
int y0 = model.getVerticesY()[n] + Utilities.getTileHeight(client.getBot(), x0, z0, gridZ) - cameraZ;
int n15 = (z0 -= cameraY) * sinY + (x0 -= cameraX) * cosY >> 16;
z0 = z0 * cosY - x0 * sinY >> 16;
x0 = n15;
n15 = y0 * cosP - z0 * sinP >> 16;
z0 = y0 * sinP + z0 * cosP >> 16;
y0 = n15;
if (z0 >= 50) {
x0 = 260 + (x0 << 9) / z0;
y0 = 171 + (y0 << 9) / z0;
if (x0 >= 0 && y0 >= 0) {
screenCoords[n] = new short[2];
screenCoords[n][0] = (short) x0;
screenCoords[n][1] = (short) y0;
}
}
}
return screenCoords;
}
Its just exact copy of Utilities.getScreenCoordinates It could be used in faster model debugging (u need add some edits ofc, thats why its snippet) for new scripters. Yeah, if you want anything more (not engine) pm me, and i will see what i can do.