finding XY coordinates for entities

Blitz3D Forums/Blitz3D Beginners Area/finding XY coordinates for entities

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

cameraproject will give you the screen coordinates of a 3d-coordinate, but still not the screen size of an entity. I'd suggest to use camerazoom (default is 1.0) * distance * real entity size.

Unfortunately the real entitysize sometimes cannot be found using MeshWidth etc. THere are some ways around this, eg:

parse all vertices of a mesh and find the min and max x,y,z (using tformpoint with vertexX etc.). These 6 Coordinates will give you a box of the real size of the entity.

But now this box is still not aligned to the screen.

A very quick and dirty workaround is to create a big screen-oriented cube around the entity, then move it towards all 6 directions seperately until MeshesIntersect will signal that the box was touching the entity (because they won't intersect as long as the entity is completely inside the box). I know, this is a silly method, but at least it works and you won't get too much headache.

If you would seek the locations of intersetion with a boolen stepwidth concept, it would also be extremly fast.