Lovely :)
Code archives/3D Graphics - Misc/Transform Texture!
This code has not been declared by its author to be Public Domain code, and therefore should not be assumed to be so.
Download source code
| This offsets a texture to center with your own rotation & scale. Very useful for shaders and stuff. Ever wanted to scale a texture and/or rotate it yet keep it in the middle? Now you can! |
Function TransTex(texture,angle#,scale#=1) ScaleTexture texture,scale,scale RotateTexture texture,angle# x#=Cos(angle)/scale/2 y#=Sin(angle)/scale/2 PositionTexture texture,(x-.5)-y,(y-.5)+x End Function |
Comments
Rob, you wrote this for me like 3 years ago...and I'm just now using it...
Where are you hiding out Rob!!
Where are you hiding out Rob!!
Late thanks for a great function!