Original Post
Hi, how can I rotate a texture around 0,5/0,5 (the Center) ?
I have a Quad(4Vertices) and a Texture on it, now I want the texture to rotate.
i havethe folowing func
{Delphi, DirectX9}
Procedure TTextureList.SetTextureMatrix(XFactor : double = 1;
YFactor : double = 1;
XPos : double = 0;
YPos : double = 0;
Angle : double = 0);
var mat, matOut,mat1 : TD3DMatrix;
Begin
mat := D3DX9.D3DXMatrixIdentity;
mat._00 := XFactor; mat._01 := 0.00;
mat._02 := 0.00; mat._03 := 0.00;
mat._10 := 0.00; mat._11 := -YFactor;
mat._12 := 0.00; mat._13 := 0.00;
mat._20 := XPos; mat._21 := YPos;
mat._22 := 0.00; mat._23 := 0.00;
mat._30 := 0.00; mat._31 := 0.00;
mat._32 := 1.40; mat._33 := 0.00;
D3DXMatrixRotationZ( mat1, Angle);
D3DXMatrixMultiply(matOut, mat, mat1);
WITH Engine.Scene.D3DDev9 DO
Begin
SetTransform( D3DTS_TEXTURE0, matOut );
SetTextureStageState( 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 );
SetTextureStageState( 0, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_PASSTHRU );
end;
end;
How have I to modify it to specify also a RotationCenter?