À°¸éü ±×¸®±â

À̹øÀåÀº ³ë¸» °ªÀ» Ãß°¡Çϱâ À§ÇÏ¿© ¹Ú½º¸¦ ±×¸°´Ù.
Ưº°È÷ ¼³¸íÇÒ²² ¾ø´Ù.



 

bool CTestApp::PostGraphics()

{
    //~~~~~~~ »ý·« ~~~~~~~

    MyVector3 p1 = MyVector3(-1.0f, 1.0f,-1.0f);

    MyVector3 p2 = MyVector3( 1.0f, 1.0f,-1.0f);

    MyVector3 p3 = MyVector3( 1.0f,-1.0f,-1.0f);

    MyVector3 p4 = MyVector3(-1.0f,-1.0f,-1.0f);

    MyVector3 p5 = MyVector3(-1.0f, 1.0f, 1.0f);

    MyVector3 p6 = MyVector3(-1.0f,-1.0f, 1.0f);

    MyVector3 p7 = MyVector3( 1.0f,-1.0f, 1.0f);

    MyVector3 p8 = MyVector3( 1.0f, 1.0f, 1.0f);

 

    MyVector3* pVertex = new MyVector3[24];

    //front

    pVertex[0] = p1;    pVertex[1] = p2;

    pVertex[2] = p3;    pVertex[3] = p4;

    //back

    pVertex[4] = p5;    pVertex[5] = p6;

    pVertex[6] = p7;    pVertex[7] = p8;

    //top

    pVertex[8] = p5;    pVertex[9] = p8;

    pVertex[10] = p2;    pVertex[11] = p1;

    //bottom

    pVertex[12] = p6;    pVertex[13] = p4;

    pVertex[14] = p3;    pVertex[15] = p7;

    //left

    pVertex[16] = p2;    pVertex[17] = p8;

    pVertex[18] = p7;    pVertex[19] = p3;

    //right

    pVertex[20] = p1;    pVertex[21] = p4;

    pVertex[22] = p6;    pVertex[23] = p5;

 

    MyVector2 t1 = MyVector2( 0.0f,  0.0f);

    MyVector2 t2 = MyVector2( 1.0f,  0.0f);

    MyVector2 t3 = MyVector2( 1.0f,  1.0f);

    MyVector2 t4 = MyVector2( 0.0f,  1.0f);

 

    MyVector2* pUV = new MyVector2[24];

    //front

    pUV[0] = t1;    pUV[1] = t2;   

    pUV[2] = t3;    pUV[3] = t4;

    //back

    pUV[4] = t2;    pUV[5] = t3;   

    pUV[6] = t4;    pUV[7] = t1;

    //top

    pUV[8] = t1;    pUV[9] = t2;   

    pUV[10] = t3;    pUV[11] = t4;

    //bottom

    pUV[12] = t4;    pUV[13] = t1;   

    pUV[14] = t2;    pUV[15] = t3;

    //left

    pUV[16] = t1;    pUV[17] = t2;   

    pUV[18] = t3;    pUV[19] = t4;

    //right

    pUV[20] = t2;    pUV[21] = t3;   

    pUV[22] = t4;    pUV[23] = t1;

 

    m_pMesh->SetNumber( 24, 12);

    m_pMesh->SetVertexData( pVertex);

    m_pMesh->SetTextureUV( pUV);

 

    //À妽º ¹öÆÛ

    USHORT* pIndex = new USHORT[36];

    pIndex[0] = 0;    pIndex[1] = 1;        pIndex[2] = 2;

    pIndex[3] = 2;    pIndex[4] = 3;        pIndex[5] = 0;

    pIndex[6] = 4;    pIndex[7] = 5;        pIndex[8] = 6;

    pIndex[9] = 6;    pIndex[10] = 7;    pIndex[11] = 4;

    pIndex[12] = 8;    pIndex[13] = 9;    pIndex[14] = 10;

    pIndex[15] = 10; pIndex[16] = 11;    pIndex[17] = 8;

    pIndex[18] = 12; pIndex[19] = 13;    pIndex[20] = 14;

    pIndex[21] = 14; pIndex[22] = 15;    pIndex[23] = 12;

    pIndex[24] = 16; pIndex[25] = 17;    pIndex[26] = 18;

    pIndex[27] = 18; pIndex[28] = 19;    pIndex[29] = 16;

    pIndex[30] = 20; pIndex[31] = 21;    pIndex[32] = 22;

    pIndex[33] = 22; pIndex[34] = 23;    pIndex[35] = 20;

    m_pMesh->SetVertexIndex(36, pIndex);

    return true;

}

 

´ÙÀ½Àº ³ë¸» °ª Ãß°¡