-
-
Save trunghieuvn/becb37b1660ed4d088e396ce9aaaf7b6 to your computer and use it in GitHub Desktop.
DirectX 3d Cube
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static const VertexPositionColor cubeVertices[] = | |
{ | |
{XMFLOAT3(-0.5f, -0.5f, -0.5f), XMFLOAT3(0.0f, 0.0f, 0.0f)}, | |
{XMFLOAT3(-0.5f, -0.5f, 0.5f), XMFLOAT3(0.0f, 0.0f, 1.0f)}, | |
{XMFLOAT3(-0.5f, 0.5f, -0.5f), XMFLOAT3(0.0f, 1.0f, 0.0f)}, | |
{XMFLOAT3(-0.5f, 0.5f, 0.5f), XMFLOAT3(0.0f, 1.0f, 1.0f)}, | |
{XMFLOAT3( 0.5f, -0.5f, -0.5f), XMFLOAT3(1.0f, 0.0f, 0.0f)}, | |
{XMFLOAT3( 0.5f, -0.5f, 0.5f), XMFLOAT3(1.0f, 0.0f, 1.0f)}, | |
{XMFLOAT3( 0.5f, 0.5f, -0.5f), XMFLOAT3(1.0f, 1.0f, 0.0f)}, | |
{XMFLOAT3( 0.5f, 0.5f, 0.5f), XMFLOAT3(1.0f, 1.0f, 1.0f)}, | |
}; | |
static const unsigned short cubeIndices [] = | |
{ | |
0,2,1, // -x | |
1,2,3, | |
4,5,6, // +x | |
5,7,6, | |
0,1,5, // -y | |
0,5,4, | |
2,6,7, // +y | |
2,7,3, | |
0,4,6, // -z | |
0,6,2, | |
1,3,7, // +z | |
1,7,5, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment