# Calculate from world to local space

**URL:** <https://forums.unrealengine.com/t/calculate-from-world-to-local-space/440461>\
**Category:** World Creation\
**Tags:** unreal-engine, Physics, question\
**Created:** [January 2, 2019, 12:58pm UTC](https://forums.unrealengine.com/t/calculate-from-world-to-local-space/440461 "2019-01-02T12:58:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ejakulatje](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ejakulatje](https://forums.unrealengine.com/u/ejakulatje)\
**Post date:** [January 2, 2019, 12:58pm UTC](https://forums.unrealengine.com/t/calculate-from-world-to-local-space/440461/1 "2019-01-02T12:58:51Z")

</div>

Does anyone know how ‘Inverse Transform Location’ works or just how i can calculate from world to local space by hand (Sockets/Bone included)?

---

<div class="post-metadata">

**Author:** ![SavvyIndoorsman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SavvyIndoorsman](https://forums.unrealengine.com/u/SavvyIndoorsman)\
**Post date:** [January 2, 2019, 4:44pm UTC](https://forums.unrealengine.com/t/calculate-from-world-to-local-space/440461/2 "2019-01-02T16:44:53Z")

</div>

The [Inverse Transform Location](https://api.unrealengine.com/INT/BlueprintAPI/Math/Transform/InverseTransformLocation/index.html) node takes a FTransform parameter and a FVector parameter. In the doc (linked in the previous sentence), you can find this helpful note:

“If T was an object’s transform, this would transform a position from world space to local space.”

So, yes, this node converts world space to local space, as you suspected; the local space you get pertains to the Transform parameter you provide.

If you need to convert a world space position to a position in local space for a specific socket, you might try grabbing the socket’s Transform using the [Get Socket Transform](https://api.unrealengine.com/INT/BlueprintAPI/Utilities/Transformation/GetSocketTransform/index.html) node. Then just plug the socket’s transform into the Inverse Transform Location node, provide a location vector, and out comes your converted local-space location.

Hopefully that answers your question!

---

<div class="post-metadata">

**Author:** ![ejakulatje](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ejakulatje](https://forums.unrealengine.com/u/ejakulatje)\
**Post date:** [January 2, 2019, 5:03pm UTC](https://forums.unrealengine.com/t/calculate-from-world-to-local-space/440461/3 "2019-01-02T17:03:43Z")

</div>

Thanks for the bulky answer, but I think I did not express the problem correctly. I dont want to use these blueprints, i just want to understand how to calculate it with a pen and paper (world to local).

---

<div class="post-metadata">

**Author:** ![SavvyIndoorsman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SavvyIndoorsman](https://forums.unrealengine.com/u/SavvyIndoorsman)\
**Post date:** [January 2, 2019, 5:51pm UTC](https://forums.unrealengine.com/t/calculate-from-world-to-local-space/440461/4 "2019-01-02T17:51:59Z")

</div>

Ah. Well, that’s a bit above my head. I suspect the math involves the use of a [Rotation Matrix](https://en.wikipedia.org/wiki/Rotation_matrix) (or perhaps a more general [Transformation Matrix](https://en.wikipedia.org/wiki/Transformation_matrix)) or two to convert from one coordinate space to another, but I don’t trust my understanding well enough to try to explain exactly how.

If you’re willing to cheat, you could always pull up the UE4 source code for the Blueprint functions I posted about above. The exact code and math that the engine uses to solve the problem will be visible there. The function in question (and a lot more related code) can be found in the [UKismetMathLibrary](https://api.unrealengine.com/INT/API/Runtime/Engine/Kismet/UKismetMathLibrary/index.html) class.

That’s all I can offer. Hope it’s of some help to you.
