# How to calculate and show OBB instead AABB

**URL:** <https://forum.babylonjs.com/t/how-to-calculate-and-show-obb-instead-aabb/13410>\
**Category:** Questions\
**Created:** [August 16, 2020, 12:19pm UTC](https://forum.babylonjs.com/t/how-to-calculate-and-show-obb-instead-aabb/13410 "2020-08-16T12:19:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gleb-cher](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gleb-cher/32/1458_2.png) [@gleb-cher](https://forum.babylonjs.com/u/gleb-cher)\
**Post date:** [August 16, 2020, 12:19pm UTC](https://forum.babylonjs.com/t/how-to-calculate-and-show-obb-instead-aabb/13410/1 "2020-08-16T12:19:02Z")

</div>

Hello!

1. How I can calculate and show OBB instead of AABB?  
[https://www.babylonjs-playground.com/#JBRUCW#3](https://www.babylonjs-playground.com/#JBRUCW#3)  
Expected result in the right part of scene.

I found that I can pass `precise` flag into `AbstractMesh.instersects()` method, but I also want to show BB.

1. How can I calculate OBB(or any baked mesh) rotation relatively to some another mesh or point on the scene?

I’am trying to implement face controller using [tfjs-models/facemesh at master · tensorflow/tfjs-models · GitHub](https://github.com/tensorflow/tfjs-models/tree/master/facemesh). From it’s ouput I can create CustomMesh and track its position using bounding box, but also I need rotation of “face”.

 ![Screenshot_20200816_151824](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/1/11d7a8b7ce2cb4445644206bf75aa573b9ec7722.jpeg) ![Screenshot_20200816_151745](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/1/15a870e0555effee2d041e1baf123452bf9e6a27.jpeg)

Sorry for my english and thanks!

---

<div class="post-metadata">

**Author:** ![aWeirdo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aweirdo/32/52_2.png) [@aWeirdo](https://forum.babylonjs.com/u/aWeirdo)\
**Post date:** [August 16, 2020, 3:08pm UTC](https://forum.babylonjs.com/t/how-to-calculate-and-show-obb-instead-aabb/13410/2 "2020-08-16T15:08:42Z")

</div>

Hi @gleb-cher  
Sorry, i’m confused, is babylon not OBB already?  
your “odd” result is simply from baking the mesh at a odd transformation 🙂

[![](https://www.researchgate.net/profile/Gang_Mei2/publication/272093426/figure/fig9/AS:614344521965582@1523482556647/Bounding-volumes-sphere-axis-aligned-bounding-box-AABB-oriented-bounding-box.png) ](https://www.researchgate.net/profile/Gang_Mei2/publication/272093426/figure/fig9/AS:614344521965582@1523482556647/Bounding-volumes-sphere-axis-aligned-bounding-box-AABB-oriented-bounding-box.png)
