TextureMappingCreateBoxMapping Method |
Create a box projection texture mapping.
Namespace:
Rhino.Render
Assembly:
RhinoCommon (in RhinoCommon.dll)
Since: 5.0
Syntax public static TextureMapping CreateBoxMapping(
Plane plane,
Interval dx,
Interval dy,
Interval dz,
bool capped
)
Public Shared Function CreateBoxMapping (
plane As Plane,
dx As Interval,
dy As Interval,
dz As Interval,
capped As Boolean
) As TextureMapping
Parameters
- plane
- Type: Rhino.GeometryPlane
The sides of the box the box are parallel to the plane's coordinate
planes. The dx, dy, dz intervals determine the location of the sides.
- dx
- Type: Rhino.GeometryInterval
Determines the location of the front and back planes. The vector
plane.xaxis is perpendicular to these planes and they pass through
plane.PointAt(dx[0],0,0) and plane.PointAt(dx[1],0,0), respectively.
- dy
- Type: Rhino.GeometryInterval
Determines the location of the left and right planes. The vector
plane.yaxis is perpendicular to these planes and they pass through
plane.PointAt(0,dy[0],0) and plane.PointAt(0,dy[1],0), respectively.
- dz
- Type: Rhino.GeometryInterval
Determines the location of the top and bottom planes. The vector
plane.zaxis is perpendicular to these planes and they pass through
plane.PointAt(0,0,dz[0]) and plane.PointAt(0,0,dz[1]), respectively.
- capped
- Type: SystemBoolean
If true, the box is treated as a finite capped box.
Return Value
Type:
TextureMappingTextureMapping instance if input is valid
Remarks
When m_texture_space = divided, the box is mapped to texture space as follows:
If the box is not capped, then each side maps to 1/4 of the texture map.
v=1+---------+---------+---------+---------+
| x=dx[1] | y=dy[1] | x=dx[0] | y=dy[0] |
| Front | Right | Back | Left |
| --y-> | <-x-- | <-y-- | --x-> |
v=0+---------+---------+---------+---------+
0/4 <=u<= 1/4 <=u<= 2/4 <=u<= 3/4 <=u<= 4/4
If the box is capped, then each side and cap gets 1/6 of the texture map.
v=1+---------+---------+---------+---------+---------+---------+
| x=dx[1] | y=dy[1] | x=dx[0] | y=dy[0] | z=dx[1] | z=dz[0] |
| Front | Right | Back | Left | Top | Bottom |
| --y-> | <x-- | <-y-- | --x-> | --x-> | --x-> |
v=0+---------+---------+---------+---------+---------+---------+
0/6 <=u<= 1/6 <=u<= 2/6 <=u<= 3/6 <=u<= 4/6 <=u<= 5/6 <=u<= 6/6
See Also