2D to 3D Cordinates and vice versa

Blitz3D Forums/Blitz3D Programming/2D to 3D Cordinates and vice versa

There's a function called positionentityfrom2D() that I found somewhere which I use. Don't know where it's from though (search on this forum really sucks :( ) or who wrote it though. The code I've got is
Function PositionEntityFrom2D (usecam, entity, x2d#, y2d#, positionGlobal = 0, camZoom# = 1)
	gw = GraphicsWidth ()
	gh = GraphicsHeight ()
	x# = -((gw / 2) - x2d)
	y# = (gh / 2) - y2d
	parent = GetParent (entity)
	EntityParent entity, usecam
	z3d# = Abs (EntityZ (entity))
	div# = (gw / (2 / camzoom)) / z3d
	PositionEntity entity, x / div, y / div, z3d, positionGlobal
	EntityParent entity, parent
End Function
I'm pretty sure there was one for the other way round, or I'm pretty sure you can use the TForm() functions.