rotating texture

Blitz3D Forums/Blitz3D Programming/rotating texture

Neochrome(Posted 2005) [#1]
i have a problem,

i have texture and drawn a oval inside it with a virtical line,

i created a sprite and added the texture onto the sprite.

now rotating the sprite like this has the effect im after, BUT i need it for the texture

when i rotate the texture it does not rotate "from the middle"

does anyone know how to achieve this? my maths isn't very good and cos, and sins i know are part of it... please help


Neochrome(Posted 2005) [#2]
im still stuck! please... help


DJWoodgate(Posted 2005) [#3]
Sigh...
http://www.blitzbasic.co.nz/codearcs/codearcs.php?code=420


Neochrome(Posted 2005) [#4]
AHH! i missed out the coordinates!!

irot = (irot +1) Mod 360
RotateTexture itex,irot
u# = Cos(irot) / 2
v# = Sin(irot) / 2

PositionTexture itex,(u-.5),(v-.5)

you can see what was missing!! haha Thanks DJWoodgate!