View Single Post
02-29-16, 06:57 AM   #44
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
The order of the rotations is irrelevant, they're rotated in opposite directions to keep the picture level while the animation creates the desired angle. I thought of all of this immediately after seeing this image in your original post:



The yellow square is the slice/wedge texture; its corner is attached to the center of the image and an animation widget is being used to rotate it around in a circle to create the (green) angle that we want.

I'll make some illustrations to hopefully clarify what's going on. Here's what we're starting with:



First, we rotate our image using an animation. This gives us our angle, but of course it also rotates the image.



We'll apply a rotation in the opposite direction to correct its orientation using SetTexCoord.



It's upright, but not quite the effect we're going for, so let's shift it to the left (actually halfway down and halfway to the right, we want it to be centered on one of its corners so it lines up with the image). This translation is done along with the rotation in one matrix transformation to generate the coordinates for SetTexCoord, but I'm showing both steps separately here.



Finally, we'll put it in a scrollframe to clip anything outside of the quarter of the image we actually want to be displayed.



That's it, the rest of the image is just 3 copies of the original texture shifted halfway to the center to make up each quarter.



Here's our final product:

  Reply With Quote