rotateUV operation

Syntax

  • rotateUV (uvSet, rotAngle)

Parameters

  1. uvSetinteger (range[0,5])
    Number of texture coordinates set. The numbering corresponds to the texture layers of the material attribute, see also texturing: essential knowledge.
  2. rotAnglefloat
    Defines the angle of the rotation.

Description

The rotateUV operation rotates the texture coordinates (uvs) of the current shape by the rotAngle.

Note:

The rotation center is at the texture position u=0 and v=0. Rotating uvs works only after the uvs have been projected.

Related

Examples

Here is an example of standard uvs and rotated uvs.

brickMap = "assets/bricks.jpg"
dirtMap = "assets/dirt.jpg"
randBuildingHeight = 1

Lot -->
   s ('.75,'1,'.75)
   center(xz)
   extrude(world.up, randBuildingHeight)
   comp(f) { side : Facade 
           | top  : set(material.color.a, .3) 
		            Roof. }

Facade -->
   # color, uv set 0
   setupProjection(0, scope.xy, scope.sx, scope.sy)
   texture(brickMap)
   projectUV(0)		# projection of the uvs
   rotateUV(0,10)		# rotate command after the projection
Standard and rotated uvs

In this topic