From the manual: http://blitzbasic.com/b3ddocs/command.php?name=CameraProject&ref=3d_cat
Basically, use the command CameraProject to obtain the coordinates, and then use ProjectedX and ProjectedY to obtain these values.
Here's some psuedo if it helps:
Global camera = CreateCamera()
Global theObject = CreateSphere()
MoveEntity theObject,0,0,5
CameraProject camera,EntityX(theObject),EntityY(theObject),EntityZ(theObject)
Print "The x coordinate of theObject is " + ProjectedX
Print "The y coordinate of theObject is " + ProjectedY
One thing to note is that this is based on the very center of the object by default, so it's possible for the values to go outside of the screen resolution range. You can either off-set the x,y,z values of CameraProject, or you can store each value returned and check to see if they are within the range you are wanting.
|