@ 2004-05-24 @
Á¤¸®ÇÏ¸é¼ ´À³¤Á¡; ¼ÒÇÁÆ®¿þ¾î·Î ·»´õ¸µ ÆÄÀÌÇÁ¸¦ ¸¸µé¾î ºÁ¼ ±×·±Áö
ÁøÂ¥ ÀÏÁÖÀÏ(5ÀÏ) µ¿¾È¿¡ ±âº»ÀûÀ̶ó°í ÇÏÁö¸¸, ´ÙÀÌ·ºÆ®X¸¦ ´Ù ¹è¿î°É º¸¸é ¿ª½Ã ±âÃÊ°¡ Áß¿äÇØ¿ä!!
1 ³ëƼ(1/5): ´ÙÀÌ·ºÆ® 3D-20030901/ ±âº»Ã¢ ¶ì¿ì±â/ »ï°¢Çü ±×¸®±â #0901-0.DirectX¶õ
D3D´Â ±¸Á¶Ã¼¸¦ ±âº»ÀûÀ¸·Î ÀÌ¿ë, ¿Þ¼Õ ½Ã°è¹æÇâ
Direct3D 9.0 ±âº»ÀûÀ¸·Î <¼±¾ð> --> <·»´õ¸µ>
<ȯ°æ¼³Á¤> --> <DATA ÀÔ·Â/ ó¸®>
0901-1.±âº»Ã¢ ¶ì¿ì±â
1.À©µµ¿ì¸¦ ¸¸µç´Ù.
2.°ÔÀÓ·çÇÁ¸¦ ¸¸µç´Ù. 3.DirectCreat9 ÇÔ¼ö¸¦ ÀÌ¿ë, Com °´Ã¼¸¦ °¡Áö°í ¿Â´Ù. 4.3D->CreateDevice ¸¦ ÀÌ¿ë, Com °´Ã¼¿¡¼ ȸ鿡 ´ëÇÑ ÀÎÅÍÆäÀ̽º¸¦ °¡Áö°í ¿Â´Ù. <¼±¾ð> LPDIRECT3D9 g_pD3D = NULL; // Used to create the D3DDevice LPDIRECT3DDEVICE9 g_pd3dDevice = NULL; // Our rendering device g_pD3D = Direct3DCreate9( D3D_SDK_VERSION ); g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &g_pd3dDevice );
5.Device¿¡¼ Clear¸¦ ½ÇÇàÇÑ´Ù.
<·»´õ¸µ> // Clear the backbuffer to a blue color g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,255), 1.0f, 0 ); ·»´õ¸µ scene // Present the backbuffer contents to the display g_pd3dDevice->Present( NULL, NULL, NULL, NULL );
6.ÇÁ·Î±×·¥ Á¾·á Àü¿¡ ¹Ýµå½Ã »ç¿ëÁßÀÎ ÀÚ¿ø ÇØÁ¦
<»èÁ¦> Device¸¦ ¸Þ¸ð¸®¿¡¼ »èÁ¦ g_pd3dDevice->Release(); g_pD3D->Release(); 0901-2.»ï°¢Çü ±×¸®±â
<¼±¾ð>
// A structure for our custom vertex type
struct D3DLVERTEX
// Our custom FVF, which describes our custom vertex structure{
FLOAT x, y, z, rhw; // The transformed position for the vertex
};DWORD color; // The vertex color
#define D3DFVF_D3DLVERTEX (D3DFVF_XYZRHW|D3DFVF_DIFFUSE)
D3DLVERTEX vertices[] = {
{ 150.0f, 50.0f, 0.5f, 1.0f, 0xffff0000, }, // x, y, z, rhw, color
};{ 250.0f, 250.0f, 0.5f, 1.0f, 0xff00ff00, }, { 50.0f, 250.0f, 0.5f, 1.0f, 0xff00ffff, }, <·»´õ¸µ> g_pd3dDevice->BeginScene(); {
g_pd3dDevice->SetFVF( D3DFVF_D3DLVERTEX );
}g_pd3dDevice->DrawPrimitiveUP( D3DPT_TRIANGLELIST, 1, vertices, sizeof(D3DLVERTEX) ); g_pd3dDevice->EndScene(); 2 ³ëƼ(2/5): ´ÙÀÌ·ºÆ® 3D-20030902/ º¯È¯¸ÅÆ®¸¯½º/ (ÀçÁú) ±¤¿ø/ ¹öÅؽº, À妽º ¹öÆÛ #0902-1.º¯È¯¸ÅÆ®¸¯½º Àû¿ë
Model --(WorldTM)--> World --(ViewTM)--> View --(ProjectTM)--> Viewport
ȸ鿡 ·»´õ¸µÀ» Çϱâ À§Çؼ´Â ÆÄÀÌÇÁ¶óÀÎÀ» µû¶ó °¢°¢ÀÇ ´Ü°è º¯È¯À» À§ÇÑ ¸ÅÆ®¸¯½º°¡ Àû¿ëµÈ´Ù. ¼ÒÇÁÆ®¿þ¾î 3D¿¡ ºñ±³Çؼ º¯È¯ ¸ÅÆ®¸¯½º´Â ÀûÁö¸¸, ±×¸¸Å API¿¡ ´õ ÀÇÁ¸ÀûÀÌ´Ù.
1) Device->SetTransform(D3DTS_WORLD, &mat);
-1.º¯È¯¸ÅÆ®¸¯½º ¼ÂÆà ; ¸ÅÆ®¸¯½º¸¦ Àû¿ëÇÏ°Ô µÇ¸é ÁÖº¯°ªµéÀÌ 0.0 - 1.0 »çÀÌÀÇ °ªÀ» °¡Áö¹Ç·Î 2) Device->SetTransform(D3DTS_VIEW, &mat); 3) D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f ); ¸ÅÆ®¸¯½º°ª¸¸ ¼³Á¤
Device->SetTransform(D3DTS_PROJECTION, &mat);
4) GetviewDevice->SetFVF( D3DFVF_D3DLVERTEX );
Á¤Á¡ÀÇ ÁÂÇ¥(¸ðµ¨ÀÇ Å©±â)¸¦ ½Å°æ½á¾ßÇϸç, ±âÁØÀÌ µÇ´Â Å©±â¸¦ ¼³Á¤ÇÏ´Â °ÍÀÌ ÁÁ´Ù.
#define D3DFVF_D3DLVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE); //#define D3DFVF_D3DLVERTEX (D3DFVF_XYZRHW|D3DFVF_DIFFUSE); - ȸ鿡 ¹Ù·Î Ãâ·ÂÇÒ ¶§ »ç¿ë RHW °ªÀÌ ÀÖÀ» °æ¿ì º¯È¯ÀÌ ³¡³ °ÍÀ¸·Î Ãë±ÞÇϱ⠶§¹®¿¡, RHW°ªÀ» Á¦°ÅÇÑ´Ù. --> ±¸Á¶Ã¼ ¸â¹öµµ º¯°æ D3DXMATRIXA16 matWorld; // world ÁÂÇ¥ º¯È ¸ÅÆ®¸¯½º D3DXMatrixRotationY( &matWorld, fAngle ); // ¸ÅÆ®¸¯½º º¯È¯(ȸÀü, À̵¿) g_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld ); // ----------> world ÁÂÇ¥·Î ÀüÈ D3DXVECTOR3 vEyePt( 0.0f, 3.0f,-5.0f ); D3DXVECTOR3 vLookatPt( 0.0f, 0.0f, 0.0f ); D3DXVECTOR3 vUpVec( 0.0f, 1.0f, 0.0f ); D3DXMATRIXA16 matView; // view ÁÂÇ¥ º¯È ¸ÅÆ®¸¯½º D3DXMatrixLookAtLH( &matView, &vEyePt, &vLookatPt, &vUpVec ); g_pd3dDevice->SetTransform( D3DTS_VIEW, &matView ); // ----------> view ÁÂÇ¥·Î º¯È D3DXMATRIXA16 matProj; // Åõ¿µ ÁÂÇ¥ º¯È¯ ¸ÅÆ®¸¯½º D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f ); g_pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );
-2.Äøµ°ú ¶óÀÌÆ®ÀÇ Ãʱ⠻óÅ ; ¸éÀÌ µÚÁý¾îÁö°Å³ª ºûÀÇ ¿µÇâÀ» ¹ÞÁö¾Ê´Â ¸ð½ÀÀ» È®ÀÎÇϱâ À§ÇÑ ¼³Á¤
// Device state would normally be set here
g_pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE ); // Culling ¸ðµå ²û
-3.Àû¿ë ; ¹öÆÛ¸¦ clear ½ÃŲÈÄ¿¡ Àû¿ëg_pd3dDevice->SetRenderState( D3DRS_LIGHTING, FALSE ); // Light ²û
g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,255), 1.0f, 0 );
// Begin the scene// End the scene
g_pd3dDevice->EndScene();
0902-2.ÀçÁú; ÀçÁúÀÌ ¾øÀ¸¸é ±¤¿øÈ¿°ú°¡ ³ªÅ¸³ªÁö ¾Ê´Â´Ù.
void SetupMaterial()
{
D3DMATERIAL9 mtrl;
}ZeroMemory( &mtrl, sizeof(D3DMATERIAL9) ); mtrl.Diffuse.r = mtrl.Ambient.r = 1.0f; mtrl.Diffuse.g = mtrl.Ambient.g = 0.0f; mtrl.Diffuse.b = mtrl.Ambient.b = 0.0f; mtrl.Diffuse.a = mtrl.Ambient.a = 1.0f; g_pd3dDevice->SetMaterial( &mtrl ); 0902-3.±¤¿ø; Á¤È®ÇÑ ±¤¿øÈ¿°ú¸¦ º¸±â À§Çؼ´Â Á¤Á¡ÀÇ ³ë¸»º¤ÅÍ°ªÀÌ Çʼö
void SetupLight()
{
D3DXVECTOR3 vecDir; // ±¤¿øÀÇ typeÀÌ D3DLIGHT_DIRECTIONALÀ̹ǷΠ¹æÇâÀÌ ÇÊ¿ä
// Finally, turn on some ambient light.D3DLIGHT9 light; ZeroMemory( &light, sizeof(D3DLIGHT9) ); light.Type = D3DLIGHT_DIRECTIONAL; // D3DLIGHT_POINT = 1 light.Diffuse.r = 1.0f; // D3DLIGHT_SPOT = 2, light.Diffuse.g = 1.0f; // D3DLIGHT_DIRECTIONAL = 3, light.Diffuse.b = 1.0f; vecDir = D3DXVECTOR3(cosf(timeGetTime()/350.0f),
1.0f,
D3DXVec3Normalize( (D3DXVECTOR3*)&light.Direction, &vecDir );sinf(timeGetTime()/350.0f) ); light.Range = 1000.0f; g_pd3dDevice->SetLight( 0, &light ); g_pd3dDevice->LightEnable( 0, TRUE ); g_pd3dDevice->SetRenderState( D3DRS_LIGHTING, TRUE );
g_pd3dDevice->SetRenderState( D3DRS_AMBIENT, (DWORD)0x00202020 );
}0902-3.zbuffer(±íÀÌ)/¹öÅؽº(Á¤Á¡) ¹öÆÛ
<¼±¾ð>
-0.ÇÁ·¹Á¨Å×ÀÌ¼Ç ÆĶó¹ÌÅÍ¿¡¼ ±íÀÌ ¹öÆÛ¿¡ ´ëÇÑ Á¤º¸¸¦ Ãß°¡
D3DPRESENT_PARAMETERS d3dpp;
-1.½Ã½ºÅÛ ÃʱâȺκп¡¼ ,zbuffer »ç¿ëÀ» ¼³Á¤ZeroMemory( &d3dpp, sizeof(d3dpp) );
...
d3dpp.EnableAutoDepthStencil = true; // ±íÀÌ°ª°ú ½ºÅÙ½Ç È°¼ºÈd3dpp.AutoDepthStencilFormat = D3DFMT_D16;
// Turn on the zbuffer
-2.¹öÅؽº(Á¤Á¡)¹öÆÛ; ½Ã½ºÅÛ ¸Þ¸ð¸®¿¡ µé¾î°¡Áö¸¸ ºñµð¿À¸Þ¸ð¸®¿¡ À§Ä¡ g_pd3dDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
D3DZB_FALSE - ±íÀÌ ¹öÆÛ¸¦ »ç¿ë ºÒ´ÉÀ¸·Î ÇÑ´Ù.
D3DZB_TRUE - z ¹öÆÛ¸¦ »ç¿ë °¡´ÉÇÏ°Ô ÇÑ´Ù.( ºñµð¿À ¸Þ¸ð¸® ºÎºÐÀ» »ç¿ë) D3DZB_USEW - w ¹öÆÛ¸¦ »ç¿ë °¡´ÉÇÏ°Ô ÇÑ´Ù. D3DZB_FORCE_DWORD - ÀÌ ¿°ÅÇüÀ» °Á¦ÀûÀ¸·Î 32 ºñÆ® »çÀÌÁî¿¡ ÄÄÆÄÀÏ ÇÑ´Ù.
D3D´Â Àåºñüũ°¡ ±âº»ÀûÀ¸·Î Áö¿øÇϸç, ¹öÆÛ¸¦ ÀÌ¿ëÇÏ°íÀÚ ÇÒ °æ¿ì ½Ã½ºÅÛ Áö¿ø¿©ºÎ¸¦ üũÇؾßÇÑ´Ù.!
LPDIRECT3DVERTEXBUFFER9 g_pVB = NULL; // Buffer to hold vertices g_pd3dDevice->CreateVertexBuffer(
4*sizeof(CUSTOMVERTEX), ÃÑÅ©±â = °¹¼ö * Å©±â
0, ½ÃÀÛ D3DFVF_CUSTOMVERTEX, Æ÷¸Ë D3DPOOL_DEFAULT, Ç®¼³Á¤ &g_pVB, ±¸Á¶Ã¼ Æ÷ÀÎÅÍ NULL );
D3DPOOL_DEFAULT - º¸Åë, ·ÎÄà ºñµð¿À ¸Þ¸ð¸®¿Í AGP (Accelerated Graphics Port)
¸Þ¸ð¸®ÀÇ ¾çÂÊ ¸ðµÎ¸¦ Æ÷ÇÔÇÑ, ºñµð¿À ¸Þ¸ð¸®ÀÌ´Ù
D3DPOOL_MANAGED - ÇÊ¿ä¿¡ µû¶ó¼, ÀåÄ¡·ÎºÎÅÍ ¾×¼¼½º ÇÒ ¼ö ÀÖ´Â ¸Þ¸ð¸®¿¡ ÀÚµ¿ÀûÀ¸·Î º¹»ç µÈ´Ù.
°ü¸®µÇ´Â ¸®¼Ò½º´Â, ½Ã½ºÅÛ ¸Þ¸ð¸®¿¡ ¹é¾÷ µÇ¹Ç·Î, ÀåÄ¡°¡ ¼Õ½ÇÇßÀ» ¶§¿¡ »ý¼º ´Ù½Ã ÇÒ ÇÊ¿ä°¡ ¾ø´Ù
D3DPOOL_SYSTEMMEM - º¸Åë, 3D ÀåÄ¡¿¡ ÀÇÇØ ¾×¼¼½º ÇÒ ¼ö ¾ø´Â ¸Þ¸ð¸®.
½Ã½ºÅÛ RAM ¸¦ »ç¿ëÇÏÁö¸¸, ÆäÀÌ¡ °¡´ÉÇÑ RAM °¡ ÁÙ¾îµé °ÍÀº ¾ø´Ù.
ÀÌ·¯ÇÑ ¸®¼Ò½º´Â, ÀåÄ¡°¡ ¼Õ½ÇÇصµ »ý¼º ´Ù½Ã ÇÒ ÇÊ¿ä°¡ ¾ø´Ù. (½Ã½ºÅÛÀÌ Áö¿øÇÏ´Â ÀåºñÀÎÁö üũÇØ¾ß ÇÑ´Ù.) -.Á¤Á¡ Á¤º¸ vertices[0].position = D3DXVECTOR3(-1.0f,-1.0f, 0.0f); vertices[0].normal = D3DXVECTOR3( -1.0f, 0.0f, 0.0f); vertices[0].color = 0xffff0000; vertices[1].position = D3DXVECTOR3( 1.0f, -1.0f, 0.0f); vertices[1].normal = D3DXVECTOR3( -1.0f, 0.0f, 0.0f); vertices[1].color = 0xff0000ff; vertices[2].position = D3DXVECTOR3( 0.0f, 1.0f, 0.0f); vertices[2].normal = D3DXVECTOR3( -1.0f, 0.0f, 0.0f); vertices[2].color = 0xffffffff; CUSTOMVERTEX* pVertices; g_pVB->Lock( 0, 0, (void**)&pVertices, 0 ); DAta rkqt memcpy( pVertices, vertices, sizeof(vertices) ); Á¤Á¡ÀÇ Á¤º¸¸¦ ¹öÅؽº Á¤º¸¿¡ Ä«ÇÇ g_pVB->Unlock();
<·»´õ¸µ>
g_pd3dDevice->BeginScene(); // ·»´õ¸µ ¹öÅؽº ¹öÆÛ¸¦ ÀÌ¿ëÇÑ °ÍÀ¸·Î º¯°æ
// Render the vertex buffer contents
g_pd3dDevice->EndScene(); 0902-4.À妽º ¹öÆÛ
Á¤Á¡Àº ¹öÅؽº ¹öÆÛ¿¡ ÀúÀåÇØ µÎ°í, ·»´õ¸µ ÇÒ ¶§´Â À妽º ÂüÁ¶ÇÏ´Â ¹æ½ÄÀ¸·Î
Á¤Á¡¼ø¼¸¦ ÀúÀåÇϱâ À§ÇÑ ¹è¿(À妽º) ÇÊ¿ä <¼±¾ð>
LPDIRECT3DINDEXBUFFER9 g_pIndex = NULL; // Our interface for manipulating index buffers
-1.À妽º ¹öÆÛ »ý¼º
...
WORD ver_index[] ={ 0, 1, 2};
g_pd3dDevice->CreateIndexBuffer( sizeof(ver_index), - À妽º ÃÑÅ©±â = °¹¼ö(1) * Å©±â
-2.À妽º ¹öÆÛ¿¡ Á¤º¸ ¼ÂÆÃ
g_pd3dDevice->SetIndices(g_pIndex); - À妽º¹öÆÛ ¼ÂÆÃ
<·»´õ¸µ>
void * indices;
g_pIndex->Lock(0,0, (void**)&indices,0);
memcpy( indices, ver_index, sizeof(ver_index) );
g_pIndex->Unlock();
g_pd3dDevice->BeginScene(); // ·»´õ¸µÀ» ÇÒ ¶§, À妽º ¹öÆÛ¸¦ ÀÌ¿ëÇÑ °ÍÀ¸·Î º¯°æ
// Render the index buffer contentsg_pd3dDevice->SetStreamSource( 0, g_pVB, 0, sizeof(CUSTOMVERTEX) ); g_pd3dDevice->SetFVF( D3DFVF_CUSTOMVERTEX );
g_pd3dDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST,0,0,3,0,1);
//g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 0, 1 ); - ¹öÅؽº ¹öÆÛ ÀÌ¿ë-. Á¤Á¡ ¹è¿À» Âü°íÇÏ´Â À妽ºÀÇ ¼ø¼¿¡ µû¶ó, ÁöÁ¤µÈ Áö¿À¸ÞÆ®¸® ±âº»µµÇüÀ» ·»´õ¸µ ÇÑ´Ù.
D3DPRIMITIVETYPE Type,
À妽º°¡ 3Á¡À» Âü°íÇÏ´Â ÀϹÝÀûÀÎ °æ¿ì¿¡´Â TyteÀ» D3DPT_TRIANGLELIST·Î ÁöÁ¤.INT BaseVertexIndex, UINT MinIndex, UINT NumVertices, - Á¤Á¡ÀÇ ÃÑ°¹¼ö UINT StartIndex, UINT PrimitiveCount ); - Àоî¿Ã À妽º °¹¼ö ¡Ø Âü°í - ¿©·¯°³ÀÇ ¹öÅؽº¹öÆÛ¿Í À妽º ¹öÆÛ°¡ ÀÖÀ» ¶§, 3 ³ëƼ(3/5): ´ÙÀÌ·ºÆ® 3D-20030903/ TextureÀû¿ë/ ¾ËÆĺ귻µù/ ÇÊÅ͸µ(ÀÚµ¿¹Ó¸Ê»ý¼º)/ ¿ÍÀ̾î... #0903-1.TextureÀû¿ë
<¼±¾ð>
-1. D3DFVF ; FVF Á¤¼ö¿¡ ÅؽºÃ³ °ü·ÃÀÇ Ç÷¡±× Ãß°¡
FVF Á¤¼ö ; À¯¿¬ÇÑ Á¤Á¡ Æ÷¸Ë (FVF)Àº, ´ÜÀÏÀÇ µ¥ÀÌÅÍ ½ºÆ®¸²¿¡ ÀÎÅ͸®ºê µÇ¾î ÀúÀå µÇ°í ÀÖ´Â
-2.»ý¼º
Á¤Á¡ÀÇ ³»¿ëÀ» ±â¼úÇϱâ À§Çؼ »ç¿ëµÈ´Ù. FVF ÄÚµå´Â, º¸Åë, °íÁ¤ ±â´ÉÀÇ Á¤Á¡ 󸮿¡ ÀÇÇØ
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_DIFFUSE|D3DFVF_TEX1 )󸮵Ǵ µ¥ÀÌÅ͸¦ ÁöÁ¤Çϱâ À§Çؼ »ç¿ëµÈ´Ù. LPDIRECT3DTEXTURE9 g_pTexture1 = NULL; // Our texture LPDIRECT3DTEXTURE9 g_pTexture2 = NULL; -3.´Ý±â Àü¿¡ »èÁ¦
g_pTexture1->Release();
<·»´õ¸µ>0903-2.Texture Addressing ; ¸ÊÀ» ºÙÄ¡´Â ¹æ½Ä¿¡ ´ëÇÑ ¼³Á¤ -. ·»´õ¸µ Àüü¿¡ ¿µÇâÀ» ¹ÌÄ¡±â ¶§¹®¿¡ µð¹ÙÀ̽º¿¡¼ Á¤ÀÇ.
<¼³Á¤>
in ½ºÅ×ÀÌÆ®°ªÀ» ¼³Á¤ÇÏ´Â ÅؽºÃ³ÀÇ ½ºÅ×ÀÌÁö ½Äº°ÀÚ. ½ºÅ×ÀÌÁö ½Äº°ÀÚ´Â 0 À¸·ÎºÎÅÍ ½ÃÀ۵ȴÙ.
ÀåÄ¡´Â ÃÖ´ë 8 ¼¼Æ®±îÁö ÅؽºÃ³¸¦ °¡Áú ¼ö°¡ ÀÖÀ¸¹Ç·Î,Stage ·Î ÁöÁ¤ÇÒ ¼ö ÀÖ´Â ÃÖ´ëÄ¡´Â 7 ÀÌ´Ù.
D3DSAMP_ADDRESSU = 1, u ÁÂÇ¥·Î »ç¿ëÇÏ´Â ÅؽºÃ³¾îµå·¹½Ì¸ðµå. µðÆúÆ®´Â D3DTADDRESS_WRAP
D3DSAMP_ADDRESSV = 2, v ÁÂÇ¥·Î »ç¿ëÇÏ´Â ÅؽºÃ³¾îµå·¹½Ì¸ðµå. µðÆúÆ®´Â D3DTADDRESS_WRAP ...
typedef enum _D3DTEXTUREADDRESS {
<Àû¿ë¿¹>
D3DTADDRESS_WRAP = 1,
} D3DTEXTUREADDRESS;D3DTADDRESS_MIRROR = 2, D3DTADDRESS_CLAMP = 3, D3DTADDRESS_BORDER = 4, D3DTADDRESS_MIRRORONCE = 5, D3DTADDRESS_FORCE_DWORD = 0x7fffffff Device->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_MIRROR ); Device->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP ); 0903-3.¾ËÆĺ귻µù
¡Ý Z-buffer°¡ ¸ÔÁö ¾Ê±â ¶§¹®¿¡ ¿øÇÏ´Â °á°ú°¡ ³ª¿Àµµ·Ï Àû¿ë ¼ø¼¿¡ Á¶½ÉÇØ¾ß Çϸç,
ºÎÇÏ°¡ ¸¹ÀÌ °É¸®±â ¶§¹®¿¡ Àû¿ëÇÒ ¿ÀºêÁ§Æ® ¾Õ¿¡¼ ÄÑÁÖ°í ²¸ÁØ´Ù.
<¼³Á¤>Device->SetRenderState( D3DRS_ALPHABLENDENABLE, true );
D3DRS_SRCBLEND = 19, D3DBLEND ¿°ÅÇüÀÇ ¸â¹öÁß ÇϳªÀÌ´Ù. µðÆúÆ®°ªÀº D3DBLEND_ONE
D3DRS_DESTBLEND = 20, D3DBLEND ¿°ÅÇüÀÇ ¸â¹öÁß ÇϳªÀÌ´Ù. µðÆúÆ®°ªÀº D3DBLEND_ZERO D3DRS_ALPHABLENDENABLE = 27, ¾ËÆÄ ºí·»µå¿¡ ÀÇÇÑ Åõ¸íÈ(TRUE¸¦ ¼³Á¤), µðÆúÆ®°ªÀº FALSE ¾ËÆÄ È¥ÇÕÀÇ Å¸ÀÔÀº, D3DRS_SRCBLEND ¿Í D3DRS_DESTBLEND ÀÇ ·»´õ¸µ ½ºÅ×ÀÌÆ®¿¡ ÀÇÇØ Á¤ÇØÁø´Ù. ...
typedef enum _D3DBLEND {
<Àû¿ë¿¹>
D3DBLEND_ZERO = 1, - È¥ÇÕ °è¼ö´Â, (0, 0, 0, 0)
} D3DBLENDD3DBLEND_ONE = 2, - È¥ÇÕ °è¼ö´Â, (1, 1, 1, 1) D3DBLEND_SRCCOLOR = 3, - È¥ÇÕ °è¼ö´Â, (Rs, Gs, Bs, As) D3DBLEND_INVSRCCOLOR = 4, - È¥ÇÕ °è¼ö´Â, (1 - Rs, 1 - Gs, 1 - Bs, 1 - As) ...
Device->SetRenderState( D3DRS_ALPHABLENDENABLE, true ); ¾ËÆĺ귣µù
0903-4.ÇÊÅ͸µ; ±ÙÁ¢Á¡, ¼±Çü, À̹漺(³ôÀÌ¿Í ³ÐÀÌÀÇ ºñ¸¦ °í·Á), ¹Ó¸Ê µîÀ» ÀÌ¿ë
<¼³Á¤>
Device->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_POINT );
typedef enum _D3DTEXTUREFILTERTYPE {
} D3DTEXTUREFILTERTYPE;
D3DTEXF_NONE = 0, - ¹Ó¸Ê 󸮸¦ ¹«È¿·Î ÇÑ´Ù. ·¡½ºÅͶóÀÌÀú´Â ´ë½Å¿¡ È®´ë ÇÊÅ͸¦ »ç¿ë
D3DTEXF_POINT = 1, - ÅؽºÃ³ÀÇ È®´ë ÇÊÅÍ ¶Ç´Â Ãà¼Ò ÇÊÅͷμ »ç¿ëµÇ´Â Á¡ÇÊÅ͸µ.
¸ñÀûÀÇ Çȼ¿°ª¿¡ °¡Àå °¡±î¿î ÁÂÇ¥¸¦ °¡Áö´Â Åؼ¿À» »ç¿ëÇÑ´Ù. ¹Ó¸Ê ·¹º§°£¿¡ »ç¿ëµÇ´Â ÅؽºÃ³ ÇÊÅÍ´Â,
D3DTEXF_LINEAR = 2, - ÅؽºÃ³ÀÇ È®´ë ÇÊÅÍ ¶Ç´Â Ãà¼Ò ÇÊÅͷμ »ç¿ëµÇ´Â ¹ÙÀ̸®´Ï¾Æ º¸°£ ÇÊÅ͸µ. ÃÖ±ÙÁ¡¹Ó¸Ê ÇÊÅÍÀÌ´Ù. ·¡½ºÅͶóÀÌÀú´Â °¡Àå °¡±î¿î ¹Ó¸Ê ÅؽºÃ³ÀÇ Åؼ¿·ÎºÎÅÍÀÇ »öÀ» »ç¿ëÇÑ´Ù
¸ñÀûÀÇ Çȼ¿À» µÑ·¯½Î´Â 2 ¡¿ 2 ¿µ¿ªÀÇ Åؼ¿ÀÇ Áß·®°¨ ÷ºÎ Æò±ÕÀ» »ç¿ëÇÑ´Ù. ¹Ó¸Ê ·¹º§°£¿¡ »ç¿ëµÇ´Â
D3DTEXF_ANISOTROPIC = 3, - ÅؽºÃ³ÀÇ È®´ë ÇÊÅÍ ¶Ç´Â Ãà¼Ò ÇÊÅͷμ »ç¿ëµÇ´Â ºñµî¹æ¼º ÅؽºÃ³ ÇÊÅ͸µ. ÅؽºÃ³ ÇÊÅÍ´Â, Æ®¶óÀÌ ¸®´Ï¾î ¹Ó¸Ê º¸°£ÀÌ´Ù. ·¡½ºÅͶóÀÌÀú´Â, °¡Àå °¡±î¿î ¹Ó¸Ê ÅؽºÃ³ 2 Á¡À¸·ÎºÎÅÍÀÇ Åؼ¿À» »ç¿ëÇØ, Çȼ¿»öÀ» ¼±Çü º¸°£ ÇÑ´Ù. (°ÔÀÓ¿¡¼ ±âº»ÀûÀ¸·Î »ç¿ë)
ÅؽºÃ³ ´Ù°¢Çü°ú ½ºÅ©¸° Æò¸é°£ÀÇ °¢µµÀÇ »óÀ§¿¡ ÀÇÇØ ÀϾ´Â Àϱ׷¯ÁüÀ» º¸Á¤ÇÑ´Ù.
D3DTEXF_PYRAMIDALQUAD = 6, - ÅؽºÃ³ÀÇ È®´ë ÇÊÅÍ ¶Ç´Â Ãà¼Ò ÇÊÅͷμ »ç¿ëÇÏ´Â 4 »ùÇÃÀÇ ÅÙÆ® ÇÊÅÍD3DTEXF_GAUSSIANQUAD = 7, - ÅؽºÃ³ÀÇ È®´ë ÇÊÅÍ ¶Ç´Â Ãà¼Ò ÇÊÅͷμ »ç¿ëÇÏ´Â 4 »ùÇÃÀÇ Gauss ÇÊÅÍ. D3DTEXF_FORCE_DWORD = 0x7fffffff
ÀÌ ¿°ÅÇüÀ» °Á¦ÀûÀ¸·Î 32 ºñÆ® »çÀÌÁî¿¡ ÄÄÆÄÀÏ ÇÑ´Ù. ÀÌ °ªÀº »ç¿ëµÇÁö ¾Ê¾Ò´Ù.
-1.ÀÚµ¿¹Ó¸Ê»ý¼º
UINT Height, - in ÃÖ»óÁ¤µµÀÇ ÅؽºÃ³ÀÇ ³ôÀÌ (Çȼ¿ ´ÜÀ§)
°ü¸®µÇ´Â ¸®¼Ò½º´Â, ½Ã½ºÅÛ ¸Þ¸ð¸®¿¡ ¹é¾÷ µÇ¹Ç·Î, ÀåÄ¡°¡ ¼Õ½ÇÇßÀ» ¶§¿¡ »ý¼º ´Ù½Ã ÇÒ ÇÊ¿ä°¡ ¾ø´ÙUINT Levels, - in ÅؽºÃ³¿¡ ÀÖ´Â ·¹º§ÀÇ ¼ö. 0 À» ÁöÁ¤ Çϸé, ¹Ó¸ÊÈ ÅؽºÃ³¸¦
Áö¿øÇÏ´Â Çϵå¿þ¾î¿¡ ´ëÇØ, 1 ¡¿ 1 Çȼ¿±îÁöÀÇ ¸ðµç ÅؽºÃ³ ¼ºê ·¹º§À» »ý¼ºÇÑ´Ù.
DWORD Usage,D3DFORMAT Format, - in D3DFORMAT ¿°ÅÇüÀÇ ¸â¹ö. ÅؽºÃ³ÀÇ Àü·¹º§ÀÇ Æ÷¸ËÀ» ±â¼ú D3DPOOL Pool, - D3DPOOL_MANAGED; S/W·Î »ç¿ëÇÒ °ÇÁö, H/W·Î »ç¿ëÇÒ °ÇÁö ÀÚµ¿ ¼³Á¤À¸·Î
D3DFMT_R8G8B8 / °ª20/ 24 ºñÆ®ÀÇ RGB Çȼ¿ Æ÷¸ËÀ¸·Î, ä³Î ±Ùó 8 ºñÆ®¸¦ »ç¿ë
<Àû¿ë¿¹>D3DFMT_A8R8G8B8 / °ª21/ 32 ºñÆ®ÀÇ ¾ËÆÄ Ã·ºÎ ARGB Çȼ¿ Æ÷¸ËÀ¸·Î, ä³Î ±Ùó 8 ºñÆ®¸¦ »ç¿ë D3DFMT_R5G6B5 / °ª23/ 16 ºñÆ®ÀÇ RGB Çȼ¿ Æ÷¸ËÀ¸·Î, »¡° 5 ºñÆ®, ÃÊ·Ï 6 ºñÆ®, ÆĶû 5 ºñÆ®¸¦ »ç¿ë ... 0903-5.¿ÍÀ̾îÇÁ·¹ÀÓ·»´õ¸µ
<¼³Á¤>
Device->SetRenderState( D3DRS_FILLMODE, D3DFILL_WIREFRAME); 4 ³ëƼ(4/5): ´ÙÀÌ·ºÆ® 3D-20030904/ ¸ÖƼÅؽºÃÄ.../ ¸ÅÆ®¸¯½º º¯È¯°ú ȯ°æ¸Ê #0904-1.¸ÖƼÅؽºÃÄ
<¼³Á¤> Àû¿ëÇÏ´Â À§Ä¡´Â texture¸¦ ºÒ·¯¿Â ´ÙÀ½¿¡¼ À§Ä¡Çϸç,
¿øÇÏ´Â ¿ÀºêÁ§Æ®ÀÇ texture¸¦ »Ñ¸®±â Àü¿¡ À§Ä¡ÇÑ´Ù.
0.HRESULT SetTexture( DWORD Stage, - in ÅؽºÃ³¸¦ ¼³Á¤ÇÏ´Â ½ºÅ×ÀÌÁö ½Äº°ÀÚ0.HRESULT SetTextureStageState( DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value );
- ÇöÀç ÇÒ´çÇÒ ¼ö ÀÖ´Â ÅؽºÃ³¿¡ ½ºÅ×ÀÌÆ®°ªÀ» ¼³Á¤
D3DTSS_COLOROP = 1,
D3DTA (ÅؽºÃ³ Àμö Á¤¼ö) - ÀåÄ¡¿¡ ´ëÀÀÇÏ´Â °¢°¢ÀÇ ÅؽºÃ³ ½ºÅ×ÀÌÁö´Â 2 °³ÀÇ ÅؽºÃ³ Àμö¸¦ D3DTSS_COLORARG1 = 2, D3DTSS_COLORARG2 = 3, D3DTSS_ALPHAOP = 4, D3DTSS_ALPHAARG1 = 5, D3DTSS_ALPHAARG2 = 6, D3DTSS_BUMPENVMAT00 = 7, D3DTSS_BUMPENVMAT01 = 8, D3DTSS_BUMPENVMAT10 = 9, D3DTSS_BUMPENVMAT11 = 10, D3DTSS_TEXCOORDINDEX = 11, ...
°¡Áö¸ç ÀÌ·¯ÇÑ Àμö´Â ÅؽºÃ³ÀÇ »ö°ú ¾ËÆÄ Ã¤³Î¿¡ ¿µÇâÀ» ÁØ´Ù.
D3DTA_CURRENT - ÅؽºÃ³ Àμö´Â ÀüÀÇ È¥ÇÕ ½ºÅ×ÀÌÁöÀÇ °á°úÀÌ´Ù.
ÃÖÃÊÀÇ ÅؽºÃ³ ½ºÅ×ÀÌÁö (½ºÅ×ÀÌÁö 0)¿¡¼´Â, ÀÌ Àμö´Â D3DTA_DIFFUSE ¿Í °°´Ù.
D3DTA_DIFFUSE - gouraud shading ó¸®Áß¿¡ Á¤Á¡ÀÇ ¼ººÐÀ¸·ÎºÎÅÍ º¸°£ ÇØ ¾òÀ» ¼ö
ÀÖ´ø µðÇ»Áî»ö
D3DTA_TEXTURE - ÅؽºÃ³ ½ºÅ×ÀÌÁöÀÇ ÅؽºÃ³ Ä÷¯ÀÌ´Ù. Çã°¡´Â Àбâ Àü¿ëÀÌ´Ù.
D3DTA_SPECULAR - gouraud shading ó¸®Áß¿¡ Á¤Á¡ÀÇ ¼ººÐÀ¸·ÎºÎÅÍ º¸°£ µÈ ½ºÆåÅ¥·¯»öÀÌ´Ù.
typedef enum _D3DTEXTUREOP {
} D3DTEXTUREOP;
D3DTOP_DISABLE = 1,
D3DTOP_SELECTARG1 = 2, - ½ºÅ×ÀÌÁöÀÇ ÃÖÃÊÀÇ »ö, ¶Ç´Â ¾ËÆÄ Àμö¸¦ º¯°æÇÏÁö ¾Ê°í Ãâ·ÂÀ¸·Î¼ »ç¿ë D3DTOP_SELECTARG2 = 3, - ½ºÅ×ÀÌÁöÀÇ 2¹ø° »ö, ¶Ç´Â ¾ËÆÄ Àμö¸¦ º¯°æÇÏÁö ¾Ê°í Ãâ·ÂÀ¸·Î¼ »ç¿ë D3DTOP_MODULATE = 4, - ÀμöÀÇ ¼ººÐÀ» °ö¼ÀÇÑ´Ù. D3DTOP_MODULATE2X = 5, D3DTOP_MODULATE4X = 6, D3DTOP_ADD = 7, - ÀμöÀÇ ¼ººÐÀ» µ¡¼À ÇÑ´Ù. D3DTOP_ADDSIGNED = 8, D3DTOP_ADDSIGNED2X = 9, D3DTOP_SUBTRACT = 10, D3DTOP_ADDSMOOTH = 11, ... <Àû¿ë> Device->SetRenderState( D3DRS_COLORVERTEX, false ); Device->SetTexture(0, g_pTexture1); Device->SetTextureStageState(0, D3DTSS_TEXCOORDINDEX, 0); Device->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); Device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); Device->SetTexture(1, g_pTexture3); Device->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 0); Device->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE); Device->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT); Device->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE); Âü°í - ·»´õ¸µ½Ã, vertexÀÇ »ö»ó¿µÇâÀ» ¹ÞÁö ¾ÊÀ»·Á¸é false·Î ¼ÂÆÃÇÑ´Ù. (ÁÖÀÇ, false·Î ¼³Á¤½Ã ´Ù¸¥ ¿É¼Ç¿¡µµ ¿µÇâÀ» ¹ÌÄ£´Ù.) Device->SetRenderState( D3DRS_COLORVERTEX, TRUE ); 0904-2.¶óÀÌÆ®¸Ê; ±âº»ÀûÀ¸·Î ¸ÖƼÅؽºÃĸ¦ ÀÀ¿ë(±Û·Î¿ì·Î È°¿ë)¸ÖƼÅؽºÃÄ
Device->SetTextureStageState(1, D3DTSS_COLOROP, MODULATE2X); - ( A*B ) <<1 (¹à¾ÆÁü)
Device->SetTextureStageState(1, D3DTSS_COLOROP, MODULATE4X); - ( A*B ) <<2 (´õ¿í ¹à¾ÆÁü) 0904-3.Á¤Á¡ÀÇ »ö°úÀÇ È¥ÇÕ
Device->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
Device->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE); - ½ºÅ×ÀÌÁö2¿¡ Á¤Á¡»öÀ» ÀÌ¿ë Device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTEXTUREOP ¿°ÅÇü); 0904-4.µðÅ×ÀϸÊ; º®À̳ª ¹Ù´Ú¿¡ °¡±õ°Ô Á¢±ÙÇßÀ» ¶§, º¸´Ù ¼±¸íÇÏ°Ô ·»´õ¸µ 0904-5.¾ËÆÄ¿¬»ê; Åõ¸íµµ¿¡¸¸ ¿µÇâÀ» ¹ÌÄ£´Ù. Èæ¹éÀÌ ¸íÈ®ÇÒ¼ö·Ï ¼±¸íÇÏ°Ô ºüÁü
<¼³Á¤>
// Alphablendging È°¼ºÈ°¡ ÇÊ¿ä 0904-6.¸ÅÆ®¸¯½º º¯È¯°ú ȯ°æ¸Ê
<¼³Á¤>
0.HRESULT SetTransform( D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX *pMatrix );
- ´ÜÀÏ ÀåÄ¡ÀÇ º¯È¯ °ü·Ã ½ºÅ×ÀÌÆ®¸¦ ¼³Á¤
D3DTS_VIEW = 2, - ºä º¯È¯ Çà·Ä·Î¼ ¼³Á¤µÇ´Â º¯È¯ Çà·ÄÀ» ½Äº°, µðÆúÆ®°ªÀº NULL(´ÜÀ§Çà·Ä)
0.HRESULT SetTextureStageState( DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value );D3DTS_PROJECTION = 3, - Åõ¿µ º¯È¯ Çà·Ä·Î¼ ¼³Á¤µÇ´Â º¯È¯ Çà·ÄÀ» ½Äº°, µðÆúÆ®°ªÀº NULL(´ÜÀ§Çà·Ä) D3DTS_TEXTURE0 = 16, - ÁöÁ¤µÈ ÅؽºÃ³ ½ºÅ×ÀÌÁö·Î ¼³Á¤µÇ´Â º¯È¯ Çà·ÄÀ» ½Äº° D3DTS_TEXTURE1 = 17, - ÁöÁ¤µÈ ÅؽºÃ³ ½ºÅ×ÀÌÁö·Î ¼³Á¤µÇ´Â º¯È¯ Çà·ÄÀ» ½Äº° ...
D3DTSS_TEXTURETRANSFORMFLAGS = 24,
ÀÌ ÅؽºÃ³ ½ºÅ×ÀÌÁöÀÇ ÅؽºÃ³ ÁÂÇ¥ÀÇ º¯È¯À» Á¦¾îÇÑ´Ù. µðÆúÆ®°ªÀº, D3DTTFF_DISABLE
typedef enum _D3DTEXTURETRANSFORMFLAGS {
D3DTTFF_DISABLE = 0, - ÅؽºÃ³ ÁÂÇ¥´Â ·¡½ºÅͶóÀÌÀú¿¡ Á÷Á¢ °Ç³×¹Þ´Â´Ù.
} D3DTEXTURETRANSFORMFLAGS;D3DTTFF_COUNT1 = 1, - ·¡½ºÅͶóÀÌÀú´Â, 1D ÀÇ ÅؽºÃ³ ÁÂÇ¥¸¦ »óÁ¤ÇÑ´Ù. D3DTTFF_COUNT2 = 2, - 2D ÀÇ ÅؽºÃ³ ÁÂÇ¥¸¦ »óÁ¤ÇÑ´Ù. D3DTTFF_COUNT3 = 3, - 3D ÀÇ ÅؽºÃ³ ÁÂÇ¥¸¦ »óÁ¤ÇÑ´Ù. D3DTTFF_COUNT4 = 4, - 4D ÀÇ ÅؽºÃ³ ÁÂÇ¥¸¦ »óÁ¤ÇÑ´Ù. D3DTTFF_PROJECTED = 256, - ÅؽºÃ³ ÁÂÇ¥´Â, ·¡½ºÅͶóÀÌÀú¿¡°Ô °Ç³×Áö±â Àü¿¡ ¸¶Áö¸· ¿ä¼Ò·Î ¸ðµÎ ºÐÇÒ
¿¹¸¦ µé¾î, ÀÌ Ç÷¡±×°¡ D3DTTFF_COUNT3 ¿Í ÇÔ²² ÁöÁ¤µÇ°í ÀÖ´Â °æ¿ì,
D3DTTFF_FORCE_DWORD = 0x7fffffff - ÀÌ ¿°ÅÇüÀ» °Á¦ÀûÀ¸·Î 32 ºñÆ® »çÀÌÁî¿¡ ÄÄÆÄÀÏ1¹ø° ¹× 2¹ø°ÀÇ ÅؽºÃ³ ÁÂÇ¥´Â, ·¡½ºÅͶóÀÌÀú¿¡°Ô °Ç³×Áö±â Àü¿¡, 3¹ø°ÀÇ ÁÂÇ¥·Î ºÐÇҵȴÙ. 0.D3DTEXTURESTAGESTATETYPE ¿°ÅÇü
D3DTSS_TEXCOORDINDEX = 11, - ÀÌ ÅؽºÃ³ ½ºÅ×ÀÌÁö¿¡¼ »ç¿ëÇϱâ À§ÇØ ¼³Á¤µÈ ÅؽºÃ³ ÁÂÇ¥ÀÇ À妽º.
0.D3DTSS_TCI - µå¶óÀ̹ö ÅؽºÃ³ ÁÂÇ¥ÀÇ ´É·Â Ç÷¡±×(ÅؽºÃ³ º¯È¯¿ëÀÇ ÀÔ·Â ÅؽºÃ³ ÁÂÇ¥¸¦ ÀÚµ¿ÀûÀ¸·Î »ý¼º)
Á¤Á¡ 1 °³¿¡ ´ëÇؼ ÃÖ´ë 8 ¼¼Æ®±îÁöÀÇ ÅؽºÃ³ ÁÂÇ¥¸¦ ¼³Á¤ÇÒ ¼ö ÀÖ´Ù.
Á¤Á¡ÀÌ, ÁöÁ¤µÈ À妽ºÀÇ ÅؽºÃ³ ÁÂÇ¥ ¼¼Æ®¸¦ Æ÷ÇÔÇÏÁö ¾ÊÀº °æ¿ì´Â, u ¹× v ÁÂÇ¥ µðÆúÆ®(0,0)
#define/ °ª / ¼³¸í
D3DTSS_TCI_PASSTHRU / 0x00000000L / Á¤Á¡ Æ÷¸Ë³»ÀÇ ÁöÁ¤µÈ ÅؽºÃ³ ÁÂÇ¥¸¦ »ç¿ë, °ªÀº Á¦·Î D3DTSS_TCI_CAMERASPACENORMAL / 0x00010000L / ½ºÅ×ÀÌÁöÀÇ ÅؽºÃ³ º¯È¯¿¡ ´ëÇÑ
ÀÔ·Â ÅؽºÃ³ ÁÂÇ¥·Î¼ Ä«¸Þ¶ó °ø°£¿¡ º¯È¯ µÈ Á¤Á¡ ¹ý¼±À» »ç¿ë
D3DTSS_TCI_CAMERASPACEPOSITION / 0x00020000L / Ä«¸Þ¶ó °ø°£¿¡ º¯È¯ µÈ Á¤Á¡ À§Ä¡¸¦ »ç¿ë D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR/ 0x00030000L /
Ä«¸Þ¶ó °ø°£¿¡ º¯È¯ µÈ ¹Ý»ç º¤Å͸¦ »ç¿ëÇϸç,
D3DTSS_TCI_SPHEREMAP / 0x00040000L / ÁöÁ¤µÈ ÅؽºÃ³ ÁÂÇ¥¸¦ ±¸¸éÀÇ ¸ÊÇο¡ »ç¿ëÇÑ´Ù. ¹Ý»ç º¤ÅÍ´Â, ÀÔ·Â Á¤Á¡ À§Ä¡ ÁÂÇ¥¿Í ¹ý¼± º¤ÅͷκÎÅÍ °è»êµÈ´Ù. <Àû¿ë> -1.¸ÊÁÂÇ¥ º¯È¯ D3DXMATRIXA16 mat; - ¸ÅÆ®¸¯½º ¼±¾ð D3DXMatrixIdentity( &mat); - ÃʱâÈ(±¸Á¶Ã¼ÀÇ ¸â¹ö¸¦ Á÷Á¢ ¼ÂÆÃÇÒ ¼ö ÀÖ´Ù.) D3DXMatrixRotationY( &mat, 5.0f); - º¯È¯(SRT); °¢°¢ÀÇ º¯È¯ Àû¿ëÈÄ ¸ÅÆ®¸¯½º¸¦ °öÇØÁØ´Ù. Device->SetTransform( D3DTS_TEXTURE0, &mat); - Çà·ÄÀ» D3DTS_TEXTURE0¿¡ Àû¿ë Device->SetTextureStageState( 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 ); - D3DTS_TEXTURE0·Î ºÎÅÍ º¯È¯µÈ uv °ªÀ» °¡Áö°í ¿Â´Ù -2.ȯ°æ¸Ê»ý¼º Device->SetTextureStageState(0, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACEPOSITION); 5 ³ëƼ(5/5): ´ÙÀÌ·ºÆ® 3D-20030905/ ½ºÅٽǹöÆÛ/ Data±¸¼º #0905-1.½ºÅĽǹöÆÛ; Çʿ俵¿ª¿¡¸¸ ·»´õ¸µ ÁöÁ¤(Ŭ¸®ÇÎ)
0905-2.Data±¸¼º
-1.¸ðµç Data´Â ·Îµù½Ã ÃʱâÈ µÇ¸ç,
Data¸¦ ¹ÙÅÁÀ¸·Î ±¸¼ºµÈ Index¿Í flag¿¡ ÀÇÇØ Á¶À۵ȴÙ.
-2.ij¸¯ÅÍ==> °á°úÀûÀ¸·Î ¸ðµç °á°ú´Â IndexÀÇ Á¶ÇÕÀÇ »ê¹°(ÀÚ·á ÀÌ¿ëÀÇ È¿À²¼º ³ôÀÓ)
¸Þ½¬¸â¹ö(ÃʱâData¸¦ ¸Å½¬·Î À籸¼º)
-3.Vertex List µîÀ» Æ÷ÀÎÅÍ·Î ¹ÞÀ» °æ¿ì´Â µ¿ÀûÇÒ´çÀÌ ÇÊ¿ä
-.Vertex List ; Á¤Á¡ÀÇ ±¸¼º -> ±¸Á¶Ã¼ Çü½ÄÀ¸·Î ÁÂÇ¥¿Í ³ë¸», Ä÷¯µî Á¤Á¡¸¸ÀÇ ¿ä¼Ò·Î ±¸¼º
¾Ö´Ï¸ÞÀ̼Ǹâ¹ö-.Index List -.VerNum -.IndexNum -.¸Þ½¬À̸§ -.¸Þ½¬ID Texture Material ÇൿÁ¤º¸(À§Ä¡, ÀΰøÁö´É ÆÐÅÏ) °¢Á¾flag ...
¸Þ¸ðÀåÀ¸·Î µ¹¾Æ°¡±â
|
Á¤º¸´Â °øÂ¥ÀÌ±æ ¿øÇÑ´Ù. HelpOnFormatting ¹Ù¶÷05 Try Essence_Àü¼Û_Å×ÀÌŸ_°ËÁõ Ã¥°¥ÇÇ_°ÔÀÓ¾ÆÅ°ÅØó&µðÀÚÀÎ |