Scale
Creates a scaling matrix.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
Scale(Vector3)
Creates a scaling matrix.
public static Matrix4x4 Scale(Vector3 vector)
Parameters
Returns
Type | Description |
|---|---|
| Matrix4x4 |
Remarks
Returned matrix is such that scales along coordinate axes by a vector . The matrix looks like this:
vusing UnityEngine;public class ExampleScript : MonoBehaviour{ void Start() { Vector3 scale = new Vector3(1, 2, 1); Matrix4x4 scaleMatrix = Matrix4x4.Scale(scale); Debug.Log(scaleMatrix); }}
Additional Resources: Matrix4x4.TRS, Matrix4x4.Rotate, Matrix4x4.Translate, Matrix4x4.SetTRS functions.
Scale(Vector3)
Creates a scaling matrix.
public static Matrix4x4 Scale(in Vector3 vector)
Parameters
Returns
Type | Description |
|---|---|
| Matrix4x4 |
Remarks
Returned matrix is such that scales along coordinate axes by a vector . The matrix looks like this:
vusing UnityEngine;public class ExampleScript : MonoBehaviour{ void Start() { Vector3 scale = new Vector3(1, 2, 1); Matrix4x4 scaleMatrix = Matrix4x4.Scale(scale); Debug.Log(scaleMatrix); }}
Additional Resources: Matrix4x4.TRS, Matrix4x4.Rotate, Matrix4x4.Translate, Matrix4x4.SetTRS functions.