# What is a Transformation Matrix

When we talk about transformations in 3D space, we mean altering the position, orientation, or scale of an object. These transformations can include various operations such as translation (shifting the position), rotation (changing the orientation), shear (distorting the shape), scale (changing the size), reflection (flipping the object), and projection (mapping the 3D point onto a 2D plane).

To perform these transformations, a common technique is to use a **transformation matrix**. A transformation matrix is a mathematical matrix that stores the information about the desired transformation. By multiplying a Vector3 representing a point(x,y,z position) with the transformation matrix, we can apply the transformation to that point.

```typescript
//Three.js
const transformationMatrix = new THREE.Matrix4(); 
transformationMatrix.set( 11, 12, 13, 14, 
	   21, 22, 23, 24,
	   31, 32, 33, 34, 
	   41, 42, 43, 44 );
	
```

When we talk about "applying the matrix to the vector," it means that the t**ransformation matrix is multiplied with the Vector3 point to achieve the desired transformation**. The resulting Vector3 will reflect the transformed position, orientation, or scale of the original point in 3D space.

#### Read more

* [Matrix4](https://threejs.org/docs/#api/en/math/Matrix4) in Three.js docs
* OpenGL [matrices tutorial](http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.xrdev.app/mixed-reality-docs/webxr-lessons/3d-on-the-web/concepts/what-is-a-transformation-matrix.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
