add texture mapping
This commit is contained in:
+17
-17
@@ -31,12 +31,12 @@ void Mesh::update(FLOAT dt)
|
||||
static FLOAT x = 0.0f;
|
||||
static FLOAT y = 0.0f;
|
||||
static FLOAT z = 0.0f;
|
||||
static FLOAT pitch = XM_PIDIV4;
|
||||
static FLOAT pitch = 0.0f;
|
||||
static FLOAT yaw = 0.0f;
|
||||
static FLOAT roll = XM_PIDIV4;
|
||||
static FLOAT roll = 0.0f;
|
||||
static FLOAT scale = 1.0f;
|
||||
|
||||
yaw += 1.0f * dt;
|
||||
//yaw += 1.0f * dt;
|
||||
|
||||
FLOAT move = 1.0f * dt;
|
||||
|
||||
@@ -123,10 +123,10 @@ UINT Mesh::createVertexBuffer(IDirect3DDevice9* pD3DDevice)
|
||||
|
||||
//// quad with trianglefan
|
||||
//// quad with trianglelist & index buffer
|
||||
//pVertices[0] = Vertex(-0.5f, 0.5f, 0.0f);
|
||||
//pVertices[1] = Vertex(0.5f, 0.5f, 0.0f);
|
||||
//pVertices[2] = Vertex(0.5f, -0.5f, 0.0f);
|
||||
//pVertices[3] = Vertex(-0.5f, -0.5f, 0.0f);
|
||||
pVertices[0] = Vertex(-0.5f, 0.5f, 0.0f, 0.0f, 0.0f);
|
||||
pVertices[1] = Vertex(0.5f, 0.5f, 0.0f, 1.0f, 0.0f);
|
||||
pVertices[2] = Vertex(0.5f, -0.5f, 0.0f, 1.0f, 1.0f);
|
||||
pVertices[3] = Vertex(-0.5f, -0.5f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
//// cube with color
|
||||
//// front
|
||||
@@ -142,17 +142,17 @@ UINT Mesh::createVertexBuffer(IDirect3DDevice9* pD3DDevice)
|
||||
//pVertices[7] = Vertex(0.5f, -0.5f, 0.5f, 200, 200, 200);
|
||||
|
||||
// cube with uv
|
||||
// front
|
||||
pVertices[0] = Vertex(-0.5f, 0.5f, -0.5f, 0.0f, 0.0f);
|
||||
pVertices[1] = Vertex(0.5f, 0.5f, -0.5f, 1.0f, 0.0f);
|
||||
pVertices[2] = Vertex(0.5f, -0.5f, -0.5f, 1.0f, 1.0f);
|
||||
pVertices[3] = Vertex(-0.5f, -0.5f, -0.5f, 0.0f, 1.0f);
|
||||
//// front
|
||||
//pVertices[0] = Vertex(-0.5f, 0.5f, -0.5f, 0.0f, 0.0f);
|
||||
//pVertices[1] = Vertex(0.5f, 0.5f, -0.5f, 1.0f, 0.0f);
|
||||
//pVertices[2] = Vertex(0.5f, -0.5f, -0.5f, 1.0f, 1.0f);
|
||||
//pVertices[3] = Vertex(-0.5f, -0.5f, -0.5f, 0.0f, 1.0f);
|
||||
|
||||
// back
|
||||
pVertices[4] = Vertex(0.5f, 0.5f, 0.5f, 0.0f, 0.0f);
|
||||
pVertices[5] = Vertex(-0.5f, 0.5f, 0.5f, 1.0f, 0.0f);
|
||||
pVertices[6] = Vertex(-0.5f, -0.5f, 0.5f, 1.0f, 1.0f);
|
||||
pVertices[7] = Vertex(0.5f, -0.5f, 0.5f, 0.0f, 1.0f);
|
||||
//// back
|
||||
//pVertices[4] = Vertex(0.5f, 0.5f, 0.5f, 0.0f, 0.0f);
|
||||
//pVertices[5] = Vertex(-0.5f, 0.5f, 0.5f, 1.0f, 0.0f);
|
||||
//pVertices[6] = Vertex(-0.5f, -0.5f, 0.5f, 1.0f, 1.0f);
|
||||
//pVertices[7] = Vertex(0.5f, -0.5f, 0.5f, 0.0f, 1.0f);
|
||||
|
||||
hr = _pVertexBuffer->Unlock();
|
||||
CheckFailed(hr, 320);
|
||||
|
||||
Reference in New Issue
Block a user