Hmmm. When working with textures that use an aspect of 1 (square), is the following condensed Transform function correct?
Lua Code:
local mcos, msin = math.cos, math.sin
local function Transform(texture, angle)
local c,s = mcos(angle), msin(angle)
local ULx, ULy = 0.5-c+s, 0.5-c-s
local LLx, LLy = 0.5-c, 0.5-s
local URx, URy = 0.5+s, 0.5-c
local LRx, LRy = 0.5, 0.5
texture:SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy)
end