Dirextx 回転・縮小・拡大

フォーラム(掲示板)ルール
フォーラム(掲示板)ルールはこちら  ※コードを貼り付ける場合は [code][/code] で囲って下さい。詳しくはこちら
ckey

Dirextx 回転・縮小・拡大

#1

投稿記事 by ckey » 9年前

コード:

void chara()
{
typedef struct{
float x, y, z;
float rhw;
D3DCOLOR cor;
float tex_u, tex_v;
}TEXTURE;

TEXTURE vertex[4];

float input = 0.0f; 
float output = 0.0f; 
float x = 130.0f, y = 120.0f;

vertex[0].x = input;
vertex[0].y = output;
vertex[0].z = 0.0f;

vertex[1].x = input + x;
vertex[1].y = output;
vertex[1].z = 0.0f;

vertex[2].x = input + x;
vertex[2].y = output + y;
vertex[2].z = 0.0f;

vertex[3].x = input;
vertex[3].y = output + y;
vertex[3].z = 0.0f;

vertex[0].rhw = 1.0f;
vertex[1].rhw = 1.0f;
vertex[2].rhw = 1.0f;
vertex[3].rhw = 1.0f;

vertex[0].cor = D3DCOLOR_XRGB(255, 255, 255);
vertex[1].cor = D3DCOLOR_XRGB(255, 255, 255);
vertex[2].cor = D3DCOLOR_XRGB(255, 255, 255);
vertex[3].cor = D3DCOLOR_XRGB(255, 255, 255);


if (GetKeyboardPress(DIK_LEFT)){
input -= 2.0f;
}
if (GetKeyboardPress(DIK_UP)){
output -= 2.0f;
}
if (GetKeyboardPress(DIK_DOWN)){
input += 2.0f;
}
if (GetKeyboardPress(DIK_RIGHT)){
output += 2.0f;
}
if (GetKeyboardPress(DIK_X)){
//縮小
}
if (GetKeyboardPress(DIK_Y)){
//拡大
} 
if (GetKeyboardPress(DIK_Z)){
//回転
}

vertex[3].tex_u = 0.0f
vertex[3].tex_v = 1.0f
vertex[0].tex_u = 0.0f;
vertex[0].tex_v = 0.0f;
vertex[1].tex_u = 1.0f;
vertex[1].tex_v = 0.0f;
vertex[2].tex_u = 1.0f;
vertex[2].tex_v = 1.0f;

g_pd3dDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, vertex, sizeof(TEXTURE));
}
回転・縮小・拡大が分かりません。
回転・縮小・拡大のソースを教えてください。

“C言語何でも質問掲示板” へ戻る