otransform VEX function

otransform, ltransform, ftransform, ontransform, lntransform, fntransform, ovtransform, lvtransform, and fvtransform query the scene for a geometry object, light or fog object of the given name.

Contexts: displace, fog, light, photon, shadow, surface

  1. matrix otransform(string name)

  2. vector otransform(string name, vector )

otransform, ltransform, ftransform, ontransform, lntransform, fntransform, ovtransform, lvtransform, and fvtransform query the scene for a geometry *o*bject, *l*ight or *f*og object of the given name. If the object exists, they return the object’s transform matrix.

The versions which take a vector argument transform the world space vector into the space of the given object/light/fog (if the object does not exist, the vector is unchanged). The “n” versions transform normal vectors, the “v” versions transform direction vectors, the base versions transform positions.

Because of the way particle instancing is implemented for vmantra, the otransform function will return the transform for one and only one particle for the given object.

When referring to objects in sub-networks, use the path to the object (without the leading “/obj/”) to reference the object, lights or atmosphere object.

See transform spaces .