runelite-api/src/main/java/net/runelite/api/Perspective.java
/**
	 * Translates two-dimensional ground coordinates within the 3D world to
	 * their corresponding coordinates on the game screen. Calculating heights
	 * based on the coordinates of the tile provided, rather than the world coordinates
	 *
	 * Using the position of each vertex, rather than the location of the object, to determine the
	 * height of each vertex causes the mesh to be vertically warped, based on the terrain below
	 *
	 * @param client
	 * @param x ground coordinate on the x axis
	 * @param y ground coordinate on the y axis
	 * @param plane ground plane on the z axis
	 * @param tileX the X coordinate of the tile the object is on
	 * @param tileY the Y coordinate of the tile the object is on
	 * @param zOffset distance from ground on the z axis
	 * @return a {@link Point} on screen corresponding to the position in
	 * 3D-space
	 */
Translates two-dimensional ground coordinates within the 3D world to
their corresponding coordinates on the game screen. Calculating heights
based on the coordinates of the tile provided, rather than the world coordinates

Using the position of each vertex, rather than the location of the object, to determine the
height of each vertex causes the mesh to be vertically warped, based on the terrain below


Translates two - dimensional ground coordinates within the 3D world to their corresponding coordinates on the game screen . Calculating heights based on the coordinates of the tile provided rather than the world coordinates Using the position of each vertex rather than the location of the object to determine the height of each vertex causes the mesh to be vertically warped based on the terrain below
public static Point worldToCanvas(@Nonnull Client client, int x, int y, int plane, int tileX, int tileY, int zOffset)
	{
		if (x >= 128 && y >= 128 && x <= 13056 && y <= 13056)
		{
			int z = getTileHeight(client, tileX, tileY, client.getPlane()) - plane;
			x -= client.getCameraX();
			y -= client.getCameraY();
			z -= client.getCameraZ();
			z -= zOffset;
			int cameraPitch = client.getCameraPitch();
			int cameraYaw = client.getCameraYaw();
			int pitchSin = SINE[cameraPitch];
			int pitchCos = COSINE[cameraPitch];
			int yawSin = SINE[cameraYaw];
			int yawCos = COSINE[cameraYaw];
			int var8 = yawCos * x + y * yawSin >> 16;
			y = yawCos * y - yawSin * x >> 16;
			x = var8;
			var8 = pitchCos * z - y * pitchSin >> 16;
			y = z * pitchSin + y * pitchCos >> 16;
			if (y >= 50)
			{
				int pointX = client.getViewportWidth() / 2 + x * client.getScale() / y;
				int pointY = client.getViewportHeight() / 2 + var8 * client.getScale() / y;
				return new Point(pointX, pointY);
			}
		}
		return null;
	}
public static Point worldToCanvas ( @ Nonnull Client client , int x , int y , int plane , int tileX , int tileY , int zOffset ) { if ( x >= 128 && y >= 128 && x <= 13056 && y <= 13056 ) { int z = getTileHeight ( client , tileX , tileY , client . getPlane ( ) ) - plane ; x -= client . getCameraX ( ) ; y -= client . getCameraY ( ) ; z -= client . getCameraZ ( ) ; z -= zOffset ; int cameraPitch = client . getCameraPitch ( ) ; int cameraYaw = client . getCameraYaw ( ) ; int pitchSin = SINE [ cameraPitch ] ; int pitchCos = COSINE [ cameraPitch ] ; int yawSin = SINE [ cameraYaw ] ; int yawCos = COSINE [ cameraYaw ] ; int var8 = yawCos * x + y * yawSin >> 16 ; y = yawCos * y - yawSin * x >> 16 ; x = var8 ; var8 = pitchCos * z - y * pitchSin >> 16 ; y = z * pitchSin + y * pitchCos >> 16 ; if ( y >= 50 ) { int pointX = client . getViewportWidth ( ) / 2 + x * client . getScale ( ) / y ; int pointY = client . getViewportHeight ( ) / 2 + var8 * client . getScale ( ) / y ; return new Point ( pointX , pointY ) ; } } return null ; }
Translates two-dimensional ground coordinates within the 3D world to
 their corresponding coordinates on the game screen.
Translates two - dimensional ground coordinates within the 3D world to their corresponding coordinates on the game screen .