-
Notifications
You must be signed in to change notification settings - Fork 103
UVMapper
cjcliffe edited this page Oct 17, 2011
·
4 revisions
The UVMapper class provides a simple procedural interface to applying U,V coordinates to a Mesh.
-
init
: Can be undefined or an object constructor.
var uvm = new CubicVR.UVMapper({
rotation: [0.0,0.0,0.0], // U,V projection rotation.
scale: [1.0,1.0,1.0], // U,V projection scale.
center: [0.0,0.0,0.0], // U,V projection center.
wrapW: 1.0, // Width wrap count for wrapping projectors.
wrapH: 1.0, // Height wrap count for wrapping projectors.
projectionMode: "planar", // U,V Projection Mode, see enums.
projectionAxis: "x" // U,V Projection Axis, see enums.
});
-
"planar"
: Planar projection along the given projection axis. -
"cylindrical"
: Cylindrical projection around the given projection axis. -
"spherical"
: Spherical projection around the given projection axis. -
"cubic"
: Cubic mapping applied based on surface normal direction. -
"sky"
: Cube-map sky mapping for application of a sky cube map.
-
"x"
: Projection on or around the X axis. -
"y"
: Projection on or around the Y axis. -
"z"
: Projection on or around the Z axis.
Apply the UVMapper to the given Mesh mesh using Material material on segment segment.
Parameters:
-
mesh
: A Mesh to apply this UVMapper to. -
material
: A Material used on faces in the Mesh to apply UVMapper to. -
segment
(optional) : A specific segment to apply this UVMapper to, default:0
-
start_face
(optional) : A specific face number to start at, default0
-
end_face
(optional) : A specific face number to end at, defaultmesh.faces.length-1
Returns:
this reference for chaining operations.
Set the U,V Projection Rotation.
Parameters:
-
rotation
: Rotation value to apply to the U,V projection, format[0.0, 0.0, 0.0]
Returns:
none
Set the U,V Projection Scale.
Parameters:
-
scale
: Scale value to apply to the U,V projection, format[0.0, 0.0, 0.0]
Returns:
none
Set the U,V Projection Center.
Parameters:
-
center
: Center value to apply to the U,V projection, format[0.0, 0.0, 0.0]
Returns:
none
Set the U,V Projection Axis.
Parameters:
-
projection_axis
: Set the U,V Projection Axis,"x"
,"y"
or"z"
Returns:
none
Set the U,V Projection mode.
Parameters:
-
projection_mode
: Set the U,V Projection Mode,"planar"
,"cylindrical"
,"spherical"
,"cubic"
or"sky"
Returns:
none
Set the U Projection Wrap Count, appplies to spherical and cylindrical projection modes.
Parameters:
-
wrap_w
: Number of times to wrap horizontally
Returns:
none
Set the V Projection Wrap Count, appplies to spherical projection modes.
Parameters:
-
wrap_h
: Number of times to wrap vertically
Returns:
none