# \#matrices

**URL:** https://discourse.threejs.org/tag/matrices/64.md

[Latest](https://discourse.threejs.org/latest.md) · [Categories](https://discourse.threejs.org/categories.md) · [Tags](https://discourse.threejs.org/tags.md)

---

## [Preventing matrix updates for static objects](https://discourse.threejs.org/t/preventing-matrix-updates-for-static-objects/74262)

<div class="topic-metadata">

**Author:** [@bobWinner](https://discourse.threejs.org/u/bobWinner)\
**Replies:** 4\
**Last updated:** [November 22, 2024, 5:38pm UTC](https://discourse.threejs.org/t/preventing-matrix-updates-for-static-objects/74262 "2024-11-22T17:38:46Z")

</div>

The docs says : Blockquote However, if you know the object will be static, you can disable this and update the transform matrix manually just when needed. object.matrixAutoUpdate = false; object.updateMatrix(); a…

---

## [Optimization of large amounts (100-1000) of Skinned Meshes (CPU bottlenecks)](https://discourse.threejs.org/t/optimization-of-large-amounts-100-1000-of-skinned-meshes-cpu-bottlenecks/58196)

<div class="topic-metadata">

**Author:** [@DolphinIQ](https://discourse.threejs.org/u/DolphinIQ)\
**Replies:** 33\
**Last updated:** [June 29, 2024, 11:07pm UTC](https://discourse.threejs.org/t/optimization-of-large-amounts-100-1000-of-skinned-meshes-cpu-bottlenecks/58196 "2024-06-29T23:07:33Z")

</div>

Greetings everyone! :wave: :smiley: First off, this is going to be a bit of a long post, not about any specific error, but rather about optimization strategies for applications with a lot of animated characters. I’ll pr…

---

## [Convert from one coordinate system to another?](https://discourse.threejs.org/t/convert-from-one-coordinate-system-to-another/13240)

<div class="topic-metadata">

**Author:** [@trusktr](https://discourse.threejs.org/u/trusktr)\
**Replies:** 49\
**Last updated:** [April 17, 2024, 4:42pm UTC](https://discourse.threejs.org/t/convert-from-one-coordinate-system-to-another/13240 "2024-04-17T16:42:51Z")

</div>

Math is my weakness. Suppose I receive data from somewhere, and I want to render it in a Three.js scene. The data assumes that X is forward, Y is left, and Z is up, while Three.js assumes (based on the default camera v…

---

## [Basis Conversion for Group with Skinned Mesh(es)?](https://discourse.threejs.org/t/basis-conversion-for-group-with-skinned-mesh-es/63980)

<div class="topic-metadata">

**Author:** [@Alfredo\_Gonzalez](https://discourse.threejs.org/u/Alfredo_Gonzalez)\
**Replies:** 0\
**Last updated:** [April 11, 2024, 6:33pm UTC](https://discourse.threejs.org/t/basis-conversion-for-group-with-skinned-mesh-es/63980 "2024-04-11T18:33:32Z")

</div>

To preface I’ve referenced the following threads: Convert from one coordinate system to another? and Standard Orientation of the World Coordinate System But neither seem to work properly for me. I have a group which …

---

## [Raycasting and rotation matrices](https://discourse.threejs.org/t/raycasting-and-rotation-matrices/61764)

<div class="topic-metadata">

**Author:** [@raaaahman](https://discourse.threejs.org/u/raaaahman)\
**Replies:** 8\
**Last updated:** [February 26, 2024, 11:07am UTC](https://discourse.threejs.org/t/raycasting-and-rotation-matrices/61764 "2024-02-26T11:07:25Z")

</div>

Hello everyone, I’ve been following (at a veeery slow pace) Freya Holmer’s awesome Math for Game Devs course, and I’m at the chapter about 4x4 matrices and cross products. Trying to replicate heur demonstration into Th…

---

## [Object3D.localToLocal](https://discourse.threejs.org/t/object3d-localtolocal/51564)

<div class="topic-metadata">

**Author:** [@abernier](https://discourse.threejs.org/u/abernier)\
**Replies:** 2\
**Last updated:** [May 14, 2023, 12:55pm UTC](https://discourse.threejs.org/t/object3d-localtolocal/51564 "2023-05-14T12:55:03Z")

</div>

Object3D’s localToWorld and worldToLocal methods are really handy shortcuts, when like me you’re too lazy/focus/stupid to deal with .applyMatrix4 and .matrixWorld/.matrixWorldInverse\[1\]. And I was this morning: I wanted…

---

## [Face landmarks detection webcam screen coordinates to NDC](https://discourse.threejs.org/t/face-landmarks-detection-webcam-screen-coordinates-to-ndc/51228)

<div class="topic-metadata">

**Author:** [@abernier](https://discourse.threejs.org/u/abernier)\
**Replies:** 1\
**Last updated:** [May 8, 2023, 6:40am UTC](https://discourse.threejs.org/t/face-landmarks-detection-webcam-screen-coordinates-to-ndc/51228 "2023-05-08T06:40:32Z")

</div>

Using face-landmarks-detection, with a 640x480 webcam I get keypoints like: // sample face const FACE = { "keypoints": \[ {"x":356.2804412841797,"y":295.1960563659668,"z":-23.786449432373047,"name":"lips"}, {"x…

---

## [How to get the MVP matrix?](https://discourse.threejs.org/t/how-to-get-the-mvp-matrix/44633)

<div class="topic-metadata">

**Author:** [@Agam\_Kashyap](https://discourse.threejs.org/u/Agam_Kashyap)\
**Replies:** 1\
**Last updated:** [November 13, 2022, 10:02am UTC](https://discourse.threejs.org/t/how-to-get-the-mvp-matrix/44633 "2022-11-13T10:02:30Z")

</div>

I wish to get the screenspace coordinates corresponding to the vertex of a Model. For doing this, I need to have access to the MVP matrix which I shall multiply with the vertex positions to get the Clip Space Coordinates…

---

## [Change of basis - memo](https://discourse.threejs.org/t/change-of-basis-memo/44595)

<div class="topic-metadata">

**Author:** [@abernier](https://discourse.threejs.org/u/abernier)\
**Replies:** 1\
**Last updated:** [November 12, 2022, 11:41am UTC](https://discourse.threejs.org/t/change-of-basis-memo/44595 "2022-11-12T11:41:01Z")

</div>

Hi, I’m currently working on a little memo to help me keep my mind clear about matrices and “change of basis” applied to THREE.js. I’d be curious if you have any feedbacks about it: whether if I did mistakes or any ide…

---

## [Matrix transformations not applied to instancedmesh](https://discourse.threejs.org/t/matrix-transformations-not-applied-to-instancedmesh/29711)

<div class="topic-metadata">

**Author:** [@Torben\_Van\_Assche](https://discourse.threejs.org/u/Torben_Van_Assche)\
**Replies:** 1\
**Last updated:** [September 8, 2021, 9:37am UTC](https://discourse.threejs.org/t/matrix-transformations-not-applied-to-instancedmesh/29711 "2021-09-08T09:37:07Z")

</div>

I have the following matrix (last one logged into console, the offset applied is set correctly on the matrices): \[ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 2.28859130859375, 0, 1\] as a result of applying this transfor…

---

## [Translation position in matrix](https://discourse.threejs.org/t/translation-position-in-matrix/28411)

<div class="topic-metadata">

**Author:** [@marcel\_pi](https://discourse.threejs.org/u/marcel_pi)\
**Replies:** 2\
**Last updated:** [July 27, 2021, 7:57pm UTC](https://discourse.threejs.org/t/translation-position-in-matrix/28411 "2021-07-27T19:57:21Z")

</div>

Hi there, The documentation says the translation amounts for x,y,z are stored on the last column of the matrix. If I create an identity matrix and make a translation like this: const matrix = new THREE.Matrix4().makeT…

---

## [How do I pass a different set of cameras' matrices to my shader?](https://discourse.threejs.org/t/how-do-i-pass-a-different-set-of-cameras-matrices-to-my-shader/27882)

<div class="topic-metadata">

**Author:** [@alii](https://discourse.threejs.org/u/alii)\
**Replies:** 0\
**Last updated:** [July 8, 2021, 2:09pm UTC](https://discourse.threejs.org/t/how-do-i-pass-a-different-set-of-cameras-matrices-to-my-shader/27882 "2021-07-08T14:09:19Z")

</div>

Hi everyone. Is there a way to use a different set of a camera’s matrices to a shader? Want to use the matrices from a stationary camera instead of a camera that Im orbiting around with. The only way I can think of is ma…

---

## [\[SOLVED\] How to update matrices manually?](https://discourse.threejs.org/t/solved-how-to-update-matrices-manually/1154)

<div class="topic-metadata">

**Author:** [@trusktr](https://discourse.threejs.org/u/trusktr)\
**Replies:** 8\
**Last updated:** [July 26, 2020, 2:35am UTC](https://discourse.threejs.org/t/solved-how-to-update-matrices-manually/1154 "2020-07-26T02:35:23Z")

</div>

ANSWER: TLDR, I am able to update local matrices easily by just // create object const object = new THREE.Object3D object.matrixAutoUpdate = false // tell Three not to update the matrix based on position, rotation, etc…

---

## [Transform matrix differences](https://discourse.threejs.org/t/transform-matrix-differences/13208)

<div class="topic-metadata">

**Author:** [@blackInk](https://discourse.threejs.org/u/blackInk)\
**Replies:** 9\
**Last updated:** [March 6, 2020, 9:04am UTC](https://discourse.threejs.org/t/transform-matrix-differences/13208 "2020-03-06T09:04:00Z")

</div>

I have the 3dsmax origin transform matrix (in 3DSMax) for an 3d object like: transform=Transform(Matrix( Vector(0.9848077, 0.1736482, 0), Vector(-0.1736482, 0.9848077, 0), Vector(0, 0, 1)), Vector(0, 0, 0)); Now I´…

---

## [Finding position of an object relative to a parent](https://discourse.threejs.org/t/finding-position-of-an-object-relative-to-a-parent/2068)

<div class="topic-metadata">

**Author:** [@trusktr](https://discourse.threejs.org/u/trusktr)\
**Replies:** 5\
**Last updated:** [March 10, 2018, 7:52pm UTC](https://discourse.threejs.org/t/finding-position-of-an-object-relative-to-a-parent/2068 "2018-03-10T19:52:30Z")

</div>

How can we find the position of an object relative to some ancestor? This would be sort of like decomposing matrixWorld, but instead of being relative to the root node (Scene) I’m looking to have it be relative to some a…

---

## [\[SOLVED\] How to set world matrices manually](https://discourse.threejs.org/t/solved-how-to-set-world-matrices-manually/1165)

<div class="topic-metadata">

**Author:** [@trusktr](https://discourse.threejs.org/u/trusktr)\
**Replies:** 1\
**Last updated:** [November 8, 2017, 1:55am UTC](https://discourse.threejs.org/t/solved-how-to-set-world-matrices-manually/1165 "2017-11-08T01:55:57Z")

</div>

Suppose I am building a tool on top of Three.js, and I calculate world matrices of my objects somewhere else outside of Three, and I want to apply the world matrices to the Object3Ds. How can we do this? I tried // ini…

---

## [Bug in Object3D.worldToLocal?](https://discourse.threejs.org/t/bug-in-object3d-worldtolocal/153)

<div class="topic-metadata">

**Author:** [@mikelhlin](https://discourse.threejs.org/u/mikelhlin)\
**Replies:** 0\
**Last updated:** [April 5, 2017, 4:49am UTC](https://discourse.threejs.org/t/bug-in-object3d-worldtolocal/153 "2017-04-05T04:49:42Z")

</div>

I needed to call updateMatrixWorld(true) before I get correct values from worldToLocal(v) yet functions such as getWorldPosition() or getWorldQuaternion() calls updateMatrixWorld(true) for you. Is the updateMatrixWorl…
