Rotates base texture UV (angle in degrees, requires BBR_TEXTURE_UV flag, auto-clones shared materials).
Takes entityHandle (mesh entity handle), angle (rotation angle in degrees double).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
entityHandleInt
angleDouble
Returns
Void
Quick Summary
Rotates base texture UV (angle in degrees, requires BBR_TEXTURE_UV flag, auto-clones shared materials).
Takes entityHandle (mesh entity handle), angle (rotation angle in degrees double).
Returns nothing.
Technical Exegesis...
Rotates base texture UV (angle in degrees, requires BBR_TEXTURE_UV flag, auto-clones shared materials). Takes entityHandle (mesh entity handle), angle (rotation angle in degrees double). Returns nothing. Updates material.baseTextureRotation to angle, controls base texture rotation around UV center (0.5, 0.5). Requires mesh.allowsUVTransforms = true (set via BBR_TEXTURE_UV flag in b3dCreateMesh or b3dLoadMesh). Mesh entities only.
This function rotates base texture coordinates.
Rotates base texture UV (angle in degrees, requires BBR_TEXTURE_UV flag, auto-clones shared materials). Takes entityHandle (mesh entity handle), angle (rotation angle in degrees double). Returns nothing. Updates material.baseTextureRotation to angle, controls base texture rotation around UV center (0.5, 0.5). Requires mesh.allowsUVTransforms = true (set via BBR_TEXTURE_UV flag in b3dCreateMesh or b3dLoadMesh). Mesh entities only.
This function rotates base texture coordinates. UV rotation: angle in degrees (positive = counter-clockwise, 0.0 = no rotation, 90.0 = quarter turn, 180.0 = upside down, 360.0 = full rotation back to start), rotates around UV center point (0.5, 0.5, texture center). UV transform requirement: mesh must be created with BBR_TEXTURE_UV flag (b3dCreateMesh(slots, BBR_TEXTURE_UV, unique) or b3dLoadMesh(filename, slots, BBR_TEXTURE_UV, unique) enables UV transforms), prints helpful error if mesh.allowsUVTransforms = false. Material handling: surface-based meshes (procedural shapes) update all surface materials directly (all surfaces get same rotation), loaded meshes (GLB models) auto-clone material if shared (calls EnsureUniqueMaterial to prevent affecting other entities). Use cases: (1) Texture orientation (rotate base texture to match mesh orientation, 90 degrees for vertical), (2) Pattern alignment (rotate wood grain to match direction, align bricks to geometry), (3) Animated rotation (spin textures for effects, rotating fans, spinning wheels), (4) Random variation (different rotation per instance for organic randomness), (5) Directional effects (rotate streaks/stripes to flow direction). Common patterns: rotate 90 degrees b3dRotateBaseTexture(entity, 90.0), spin animation angle = angle + 1.0 then b3dRotateBaseTexture(entity, angle), random rotation b3dRotateBaseTexture(entity, mathRnd(360.0)). Typical usage: rotate to align base texture with mesh features, animate rotation for spinning effects (wheels, fans, whirlpools), set random rotation per instance for variation (wood grain, stone patterns), adjust orientation for directional textures. UV coordinate math: rotation matrix applied around center (0.5, 0.5), UVs transformed via cos/sin of angle (shader computes rotated coordinates on GPU). Rotation center: always rotates around UV (0.5, 0.5) texture center (not corner, provides intuitive rotation), cannot customize center point. Angle wrapping: angles > 360 or < 0 wrap around (angle=450 same as angle=90, angle=-90 same as angle=270), full rotations multiples of 360 have no effect. Rotation defaults: likely 0.0 if never set (verify during testing, 0.0 = no rotation, texture aligned to UV axes). Material auto-cloning: loaded meshes (GLB) automatically call EnsureUniqueMaterial if shared (clones mesh and material for per-entity rotation), prevents affecting other instances. Animated rotation: increment angle each frame for spinning textures (fans, wheels, whirlpools), use mathMod(angle, 360.0) to prevent overflow. Performance: O(1) for loaded mesh (updates single material after clone), O(N) for surface-based mesh with N surfaces, rotation matrix computed in shader (sin/cos per pixel, moderate cost). Validation: prints error if invalid entity handle, entity not mesh, UV transforms not allowed, entity has no valid material. Related: b3dScaleBaseTexture scales base texture UV, b3dPositionBaseTexture offsets base texture UV, b3dCreateMesh creates mesh with BBR_TEXTURE_UV flag, b3dLoadMesh loads mesh with BBR_TEXTURE_UV flag, b3dRotateDetailTexture rotates detail texture UV (separate from base).