I would like to have some hints how to use the GetScreenCoord() from the PDK API, since the documentation is not very clear and there's no sample that use this function.
From what I gather, it might be used to transform a set of coordinates in the 3d world in screen coordinates, however, it's usage is not very clear. I was able to write some code, and it works fine, no errors, and the call returns data that as expected, change according to the camera viewpoint, but I don't fully understand how they are supposed to be used.
I used the 2nd variant of the function, that takes only a list of offsets and returns a list of screencoordinates and, according to the documentation, it's supposed to
"Get the screen space coordinates of a list of points relative to user sim object"
- What kind of coordinates the returned values represent ? Offset in meters ? Or something else ? Do they have to be transformed in some way ?
- Why the coordinates are returned as set of 3, aren't they supposed to be "screen" coordinates, hence 2d ? The 3rd z value it's usually from -1 to 1...the documentation is a bit confusing, since the returned parameter is explained as:
Code: Select all
void GetScreenCoord ( const float xyzOffset[][3], float xyOutput[][3], const int count ) const
I think this part of the SDK could use a bit more explanations, or samples.