View Single Post
07/06/17, 03:34 PM   #1
dorrino
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 50
[outdated] Set3DRenderSpaceToUnitTag(control, unitTag)

Currently the only way (known to me) to read 3D coordinates of any ingame entity is to use your camera location as a reference using Set3DRenderSpaceToCurrentCamera, then read its coordinates using Get3DRenderSpaceOrigin, then do some Black Magic(tm) to find 3d coordinates of the player from 3d coordinates of the camera and THEN use 3d coordinates of the player along with his 2d map coordinates to find 3d coordinates of a map entity.

This becomes a pain since there's no clear way to find 3d coordinates of the player himself from the coordinates of the camera. I use a bunch of workarounds in my pvpalerts for this.

Additionally one of the major problems is to determine height or Y-axis position of an entity with known x,y 2d coordinates on the map.

So, generally, there's a need to find 3d coordinates of an entity in the gameworld or at least a precise correspondence between its 3d coordinates and map coordinates.

The proposed function Set3DRenderSpaceToUnitTag(control, unitTag) will take 'player' and 'groupX' unittags as its input and should solve this problem of locating 3d coordinates of the player himself and his group members.

Second request is to return Y-3d coordinates (or all X,Y,Z - 3d coordinates) along with 2d map coordinates in various functions like GetAvAObjectiveInfo, GetMapPlayerPosition etc. I assume this request might be more complicated than Set3DRenderSpaceToUnitTag proposed above, though. But it will allow to put custom 3d controls anywhere in the gameworld with the necessary precision.

Thank you.