# Picked point at wrong position

**URL:** <https://forum.babylonjs.com/t/picked-point-at-wrong-position/51698>\
**Category:** Bugs\
**Tags:** glb, picking\
**Created:** [July 1, 2024, 3:19am UTC](https://forum.babylonjs.com/t/picked-point-at-wrong-position/51698 "2024-07-01T03:19:14Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [July 4, 2024, 7:56pm UTC](https://forum.babylonjs.com/t/picked-point-at-wrong-position/51698/21 "2024-07-04T19:56:27Z")

</div>

Assigned @bghgary on July 4, 2024, 7:56pm UTC



---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [July 8, 2024, 8:28pm UTC](https://forum.babylonjs.com/t/picked-point-at-wrong-position/51698/22 "2024-07-08T20:28:19Z")

</div>

Sorry for the delay. I’m back now and will investigate.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [July 8, 2024, 8:34pm UTC](https://forum.babylonjs.com/t/picked-point-at-wrong-position/51698/23 "2024-07-08T20:34:26Z")

</div>

My immediate observation is that this is not a regression from my PR since it repros with `6.49.0` and `5.71.1`.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [July 8, 2024, 11:40pm UTC](https://forum.babylonjs.com/t/picked-point-at-wrong-position/51698/24 "2024-07-08T23:40:28Z")

</div>

Just for reference, the data in the GLB is bad since the glTF chunk has a length that is not aligned to 4-bytes. If you put the asset in the glTF-Validator, it reports:

```json
{
  "code": "GLB_CHUNK_LENGTH_UNALIGNED",
  "message": "Length of 0x4e4f534a chunk is not aligned to 4-byte boundaries.",
  "severity": 0,
  "offset": 12
}

```

This will result in undefined behavior. It looks like this is generated by Blender. Maybe use a newer version to see if the problem has already been fixed. Otherwise, please file an issue with Blender as this is an invalid GLB file.

For Babylon.js, this used to throw an exception, but we allowed it at some point with [this commit](https://github.com/BabylonJS/Babylon.js/commit/9c2df86f54d7660b859eabcdb3b096c1f83800d4) from @Deltakosh. This code got moved around a bit. This code makes it such that the code doesn’t throw exceptions anymore, but it also will end up with bad misaligned data. The proposed [PR](https://github.com/BabylonJS/Babylon.js/pull/15247) fixes the problem, but it copies the buffer (as it has to in order to have correct data) which is a slow operation. It also now needs to be in multiple places as I’ve copied this part of the code in another function. I’ll note this in the PR and we can continue from there.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [July 9, 2024, 4:25pm UTC](https://forum.babylonjs.com/t/picked-point-at-wrong-position/51698/25 "2024-07-09T16:25:01Z")

</div>

Unassigned @bghgary on July 9, 2024, 4:25pm UTC



[Previous page](https://forum.babylonjs.com/t/picked-point-at-wrong-position/51698.md?page=1)
