View Single Post
03-01-16, 05:21 AM   #49
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Hmmm. When working with textures that use an aspect of 1 (square), is the following condensed Transform function correct?

Lua Code:
  1. local mcos, msin = math.cos, math.sin
  2. local function Transform(texture, angle)
  3.   local c,s = mcos(angle), msin(angle)
  4.   local ULx, ULy = 0.5-c+s, 0.5-c-s
  5.   local LLx, LLy = 0.5-c, 0.5-s
  6.   local URx, URy = 0.5+s, 0.5-c
  7.   local LRx, LRy = 0.5, 0.5  
  8.   texture:SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy)
  9. end
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 03-01-16 at 06:49 AM.
  Reply With Quote