|Context(s)||displace fog light shadow surface|
void getuvtangents(string objName, vector P, vector dir, vector &Tu, vector &Tv)
This variant additionally sets Tn to the evaluation point’s surface normal:
void getuvtangents(string objName, vector P, vector dir, vector &Tu, vector &Tv, vector &Tn)
The object must have a vector attribute named "uv".
Passing "" as the
objName parameter will cause the function to use the current shaded object.
Name of object to evaluate UV tangents for.
Point at which to evaluate UV tangents.
The direction to use for searching the object’s surface.
The surface of the object is searched for by casting rays from
P in this direction as well as the opposite direction.
When available, it makes sense to use the normal at the point being evaluated.
UV tangent in U direction.
UV tangent in V direction.
The surface normal at the point where tangents are evaluated.
// Get UV tangent at 'P', searching the surface in the direction of 'N' vector Tu, Tv; getuvtangents("/obj/geo1", P, N, Tu, Tv);
// Find a surface location using an arbitrary ray. // In this case the surface normal isn't known beforehand and can be fetched via 'Tn'. vector Tu, Tv, Tn; getuvtangents("/obj/geo1", ray_orig, ray_dir, Tu, Tv, Tn);