Description
The NormalToWorld
method of the Transform
struct converts a normal vector from local space to world space. This is useful when you need to transform a direction or normal vector that is defined in the local coordinate system of an object to the global coordinate system of the scene.
Usage
To use the NormalToWorld
method, you need to have a Transform
instance that represents the transformation of the object. You can then call this method with a local normal vector to get the corresponding world space normal vector.
Example
// Assume 'transform' is an instance of Transform
Vector3 localNormal = new Vector3(0, 1, 0); // A normal pointing up in local space
Vector3 worldNormal = transform.NormalToWorld(localNormal);
// 'worldNormal' now contains the normal vector in world space.