I tried to combine the shooting game template with the Astra. However, as you can see in the picture, the skeleton showed in the scene is too small. I adjusted the scale to 20 times in the transform column, but it didn’t work. Please teach me how to make the skeleton much bigger. Thank you very much!
It seemed to be the problem of GUI and camera.
I found that the size of the skeleton would change according to the view of the camera. For example, when the camera is closing to the skeleton, the size of the skeleton will be bigger. However, in the case I asked above, because the camera is not working under the canvas render setting (Screen Space - Overlay), the size of the skeleton won’t be bigger or smaller when I move the camera. So far, I had no idea how to solve it.
Besides, I found the skeleton was always at the center of the scene, while the gameobject of the skeleton was at the other place. If I move the gameobject, the skeleton is still at the center of the scene. Is it because the coordinate was fixed in the Astra controller script?
void PrintDepth(Astra.DepthFrame depthFrame,
Astra.CoordinateMapper mapper)
{
if (depthFrame != null)
{
int width = depthFrame.Width;
int height = depthFrame.Height;
long frameIndex = depthFrame.FrameIndex;
//determine if buffer needs to be reallocated
if (width != _lastWidth || height != _lastHeight)
{
_buffer = new short[width * height];
_lastWidth = width;
_lastHeight = height;
}
depthFrame.CopyData(ref _buffer);
int index = (int)((width * (height / 2.0f)) + (width / 2.0f));
short middleDepth = _buffer[index];
Vector3D worldPoint = mapper.MapDepthPointToWorldSpace(new Vector3D(width / 2.0f, height / 2.0f, middleDepth));
Vector3D depthPoint = mapper.MapWorldPointToDepthSpace(worldPoint);
}
}
hello, could you please let me know how you are using this Vector3D worldPoint = mapper.MapDepthPointToWorldSpace(new Vector3D(width / 2.0f, height / 2.0f, middleDepth)); ?