add transformation
This commit is contained in:
@@ -28,6 +28,21 @@ UINT Mesh::init(IDirect3DDevice9* pD3DDevice)
|
||||
|
||||
void Mesh::update(FLOAT dt)
|
||||
{
|
||||
static FLOAT x = 0.0f;
|
||||
static FLOAT y = 0.0f;
|
||||
static FLOAT z = 0.0f;
|
||||
static FLOAT pitch = 0.0f;
|
||||
static FLOAT yaw = 0.0f;
|
||||
static FLOAT roll = 0.0f;
|
||||
static FLOAT scale = 1.0f;
|
||||
|
||||
yaw += 0.01f;
|
||||
|
||||
XMMATRIX translationMatrix = XMMatrixTranslation(x, y, z);
|
||||
XMMATRIX rotationMatrix = XMMatrixRotationRollPitchYaw(pitch, yaw, roll);
|
||||
XMMATRIX scaleMatrix = XMMatrixScaling(scale, scale, scale);
|
||||
|
||||
XMStoreFloat4x4(reinterpret_cast<XMFLOAT4X4*>(&_worldMatrix), scaleMatrix * rotationMatrix * translationMatrix);
|
||||
}
|
||||
|
||||
void Mesh::render(IDirect3DDevice9* pD3DDevice)
|
||||
|
||||
Reference in New Issue
Block a user