# Reprojection and pointer pose API in native C\_API

**URL:** <https://forum.magicleap.cloud/t/reprojection-and-pointer-pose-api-in-native-c-api/1229>\
**Category:** Native Development\
**Tags:** development\
**Created:** [November 21, 2022, 3:09pm UTC](https://forum.magicleap.cloud/t/reprojection-and-pointer-pose-api-in-native-c-api/1229 "2022-11-21T15:09:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![a.al-darraji](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@a.al-darraji](https://forum.magicleap.cloud/u/a.al-darraji)\
**Post date:** [November 21, 2022, 3:09pm UTC](https://forum.magicleap.cloud/t/reprojection-and-pointer-pose-api-in-native-c-api/1229/1 "2022-11-21T15:09:44Z")

</div>

I am trying to implement re-projection; I was wondering if the native C\_API provide an API to override the re-projection matrix. because as far as I Know, OpenXR does require this facility to exist in the API.

on a second note, is there an API to directly get the pointer pose, something like the beam coming out of the controller, but from the hand? I am implementing an interactive application that doesn't require  
the controller, so if such API exists that would be useful.

Best,  
Ali

---

<div class="post-metadata">

**Author:** ![kdowney](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kdowney/32/481_2.png) [@kdowney](https://forum.magicleap.cloud/u/kdowney)\
**Post date:** [November 21, 2022, 6:40pm UTC](https://forum.magicleap.cloud/t/reprojection-and-pointer-pose-api-in-native-c-api/1229/2 "2022-11-21T18:40:39Z")

</div>

Hi @a.al-darraji, Thanks for your post. I talked with our C API engineers and you could potentially look into the `MLGestureClassfication` C APIs. In the `ml_gesture_classification.h` header we have `MLGestureClassificationStaticData.hand_interaction` point which could be handy for your use case. Please let me know if this unblocks you.

For your first question, we're discussing and I'll report back asap.

---

<div class="post-metadata">

**Author:** ![kdowney](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kdowney/32/481_2.png) [@kdowney](https://forum.magicleap.cloud/u/kdowney)\
**Post date:** [November 21, 2022, 7:56pm UTC](https://forum.magicleap.cloud/t/reprojection-and-pointer-pose-api-in-native-c-api/1229/3 "2022-11-21T19:56:20Z")

</div>

@a.al-darraji, For your first question, I confirmed with our engineers the C API does not allow you to customize the re-projection matrix. Please let me know if you have any additional questions.

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [November 22, 2022, 3:11pm UTC](https://forum.magicleap.cloud/t/reprojection-and-pointer-pose-api-in-native-c-api/1229/4 "2022-11-22T15:11:08Z")

</div>

@a.al-darraji If you think overriding the projection matrix is important, can you let us know your use case so we can submit it to the voice of customer team?

---

<div class="post-metadata">

**Author:** ![a.al-darraji](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@a.al-darraji](https://forum.magicleap.cloud/u/a.al-darraji)\
**Post date:** [November 23, 2022, 8:51am UTC](https://forum.magicleap.cloud/t/reprojection-and-pointer-pose-api-in-native-c-api/1229/5 "2022-11-23T08:51:08Z")

</div>

Thanks for your reply.  
The use case is that we have a streaming Service over a network, we render on the server and send the rendered image to the client. To compensate for the latency on the network, as well as the time it takes to render the image, we use reprojection. Having an API that allow to override it directly, simplifies the operation and I hope it will also be more performant that writing a custom vertex & fragment shaders that do it.

---

<div class="post-metadata">

**Author:** ![a.al-darraji](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@a.al-darraji](https://forum.magicleap.cloud/u/a.al-darraji)\
**Post date:** [November 24, 2022, 1:45pm UTC](https://forum.magicleap.cloud/t/reprojection-and-pointer-pose-api-in-native-c-api/1229/6 "2022-11-24T13:45:49Z")

</div>

Thanks for your reply,

This from my understanding, this interaction point is static? that is, it doesn't get updated?  
Compared to Hand Tracking or headtracking, where there are **get\_static\_data** method and **get\_data** methods.

However, for Gesture Classification, it seems **hand\_interaction** point is only a static data, how does it get updated?  
from the documentation, it mentions it gets updated based on the posture, but I don't find the method to update/get the **hand\_interaction\_point** based on the newest snapshot/detected hand.

---

<div class="post-metadata">

**Author:** ![a.al-darraji](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@a.al-darraji](https://forum.magicleap.cloud/u/a.al-darraji)\
**Post date:** [November 24, 2022, 2:24pm UTC](https://forum.magicleap.cloud/t/reprojection-and-pointer-pose-api-in-native-c-api/1229/7 "2022-11-24T14:24:15Z")

</div>

For the record, this is how I am doing it right now, but it seems to be wrong to me.

```auto
//Called once at start up
InitGestures()
{
    UNWRAP_MLRESULT(MLGestureClassificationCreate(&gesture_handle_));
    MLGestureClassificationStaticDataInit(&gesture_static_data);
    UNWRAP_MLRESULT_FATAL(MLGestureClassificationGetStaticData(gesture_handle_, &gesture_static_data));

}

//-------- Called on every frame ------------//
UpdateGestures()
{
   MLSnapshot *snapshot = nullptr;
   MLPerceptionGetSnapshot(&snapshot);
  if(MLResult_Ok == MLSnapshotGetTransform(snapshot,&gesture_static_data.hand_interaction[0], 
                                                                             &interaction_point_transform))
       {
          LogTransform(interaction_point_transform);
       }
}

```

The reason I believe this is wrong, because the left\_hand interaction point transform is logged, even if there is no hand in the scene.  
I believe this method should return : **PoseNotFound** as per the documentation of **MLSnapShotGetTransform**

---

<div class="post-metadata">

**Author:** ![a.al-darraji](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@a.al-darraji](https://forum.magicleap.cloud/u/a.al-darraji)\
**Post date:** [January 6, 2023, 6:18am UTC](https://forum.magicleap.cloud/t/reprojection-and-pointer-pose-api-in-native-c-api/1229/8 "2023-01-06T06:18:35Z")

</div>

Happy new year,  
Is there any updates on this?
