rotateUV operation

Syntax

  • rotateUV(uvSet, angle)

Parameters

  1. uvSetfloat
    Number of texture coordinates set (integer number in [0,9]). The numbering corresponds to the texture layers of the material attribute, see also Texturing: Essential knowledge.
  2. anglefloat
    Defines the angle of the rotation.

Description

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

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