Game Development Community

Getting objects 2D position on screen

by Dracola · in Torque Game Engine · 07/06/2006 (5:55 pm) · 2 replies

I want to get an objects position on the screen so I can layer a targeting esque GUI over the player. How would this be done? I know you can get where the mouse is clicking on the terrain but I echo'd the mouses position and vector and the mouses position stays the same no matter where you move it or how you twist the camera so I don't know how it is getting the vector. I figure the screen is like a flat plane laid out in front of the camera but I don't know how far off it is offsetted. If somebody could tell me that I could probably figure it out from there.

#1
07/06/2006 (6:13 pm)
project(<Point3F>, <&Point3F>)
That's not the actual members of the function, but that's basically what you put in. The first parameter is a Point3F containing the position of the object, and the second is the address of a Point3F you want the values to be passed into. You can see an example of it being used in guiShapeNameHUD.
#2
07/06/2006 (6:20 pm)
Darn before I posted this I thought "are there any gui's that track the player" and the shapes names completely jumped my mind. Thanks I'll see how this function works out for me.