Jump to content
  • Advertisement
Sign in to follow this  
griffyboy0

Odd texturing issues

This topic is 5012 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm in the process of creating a skybox for my game, however when I render the skybox I've created from scratch, all of the textures get really messed up. Heres an example of what I'm talking about. Clicky The texture that I'm placing on the quads looks like this Clicky EDIT: My host is being retarded right now.. Pictures up in a bit. EDIT2: Pictures back up. Thanks Imageshack I have double and triple checked my vertex and texture coords. Heres the functions that create and render the skybox. <script> //*************************************************************** //*** SetSkyboxState() - Sets the current state of the skybox *** //*************************************************************** //Directions: // //Call this wherever you want to. //This is the first step to make a skybox. // //Values are //1 = SB_NOON - Noon //2 = SB_TRANS_EARLY - Morning, or Early Evening //3 = SB_TRANS_LATE - Early Morning, or Evening //4 = SB_NIGHT - Night //5 = SB_NIGHT_CLEAR - Starry Night //6 = SB_RAIN_MORNING - Rainy Morning //7 = SB_RAIN_NOON - Rainy Noon //8 = SB_RAIN_EVENING - Rainy Evening //9 = SB_RAIN_NIGHT - Rainy Night void CEnvironment::SetSkyboxState(int state) { if( state == 1)//If the flag is set to make the skybox noon... { D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Noon_Right.bmp", &skbx_Tex_Right );//<-- D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Noon_Left.bmp", &skbx_Tex_Left );// Then set the skybox textures D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Noon_Front.bmp", &skbx_Tex_Front );// | likewise D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Noon_Back.bmp", &skbx_Tex_Back );// | D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Noon_Top.bmp", &skbx_Tex_Top );//<------ } if( state == 2)//If the flag is set to make the skybox morn, or early afternoon... { D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Trans_Early_Right.bmp", &skbx_Tex_Right );//<-- D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Trans_Early_Left.bmp", &skbx_Tex_Left );// Then set the skybox textures D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Trans_Early_Front.bmp", &skbx_Tex_Front );// | likewise D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Trans_Early_Back.bmp", &skbx_Tex_Back );// | D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Trans_Early_Top.bmp", &skbx_Tex_Top );//<------ } if( state == 3)//If the flag is set to make the skybox early morning, or late afternoon... { D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Trans_Late_Right.bmp", &skbx_Tex_Right );//<-- D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Trans_Late_Left.bmp", &skbx_Tex_Left );// Then set the skybox textures D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Trans_Late_Front.bmp", &skbx_Tex_Front );// | likewise D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Trans_Late_Back.bmp", &skbx_Tex_Back );// | D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Trans_Late_Top.bmp", &skbx_Tex_Top );//<------ } if( state == 4 )//If the flag is set to make the skybox night... { D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Night_Right.bmp", &skbx_Tex_Right );//<-- D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Night_Left.bmp", &skbx_Tex_Left );// Then set the skybox textures D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Night_Front.bmp", &skbx_Tex_Front );// | likewise D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Night_Back.bmp", &skbx_Tex_Back );// | D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Night_Top.bmp", &skbx_Tex_Top );//<------ } if( state == 5)//If the flag is set to make the skybox a clear starry night... { D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Night_Clear_Right.bmp", &skbx_Tex_Right );//<-- D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Night_Clear_Left.bmp", &skbx_Tex_Left );// Then set the skybox textures D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Night_Clear_Front.bmp", &skbx_Tex_Front );// | likewise D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Night_Clear_Back.bmp", &skbx_Tex_Back );// | D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Night_Clear_Top.bmp", &skbx_Tex_Top );//<------ } if( state == 6)//If the flag is set to make the skybox a rainy morning { D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Morning_Right.bmp", &skbx_Tex_Right );//<-- D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Morning_Left.bmp", &skbx_Tex_Left );// Then set the skybox textures D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Morning_Front.bmp", &skbx_Tex_Front );// | likewise D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Morning_Back.bmp", &skbx_Tex_Back );// | D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Morning_Top.bmp", &skbx_Tex_Top );//<------ } if( state == 7)//If the flag is set to make the skybox a rainy noon... { D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Noon_Right.bmp", &skbx_Tex_Right );//<-- D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Noon_Left.bmp", &skbx_Tex_Left );// Then set the skybox textures D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Noon_Front.bmp", &skbx_Tex_Front );// | likewise D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Noon_Back.bmp", &skbx_Tex_Back );// | D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Noon_Top.bmp", &skbx_Tex_Top );//<------ } if( state == 8)//If the flag is set to make the skybox a rainy evening... { D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Evening_Right.bmp", &skbx_Tex_Right );//<-- D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Evening_Left.bmp", &skbx_Tex_Left );// Then set the skybox textures D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Evening_Front.bmp", &skbx_Tex_Front );// | likewise D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Evening_Back.bmp", &skbx_Tex_Back );// | D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Evening_Top.bmp", &skbx_Tex_Top );//<------ } if( state == 9)//If the flag is set to make the skybox a rainy night... { D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Night_Right.bmp", &skbx_Tex_Right );//<-- D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Night_Left.bmp", &skbx_Tex_Left );// Then set the skybox textures D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Night_Front.bmp", &skbx_Tex_Front );// | likewise D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Night_Back.bmp", &skbx_Tex_Back );// | D3DXCreateTextureFromFile( DX->g_pd3dDevice, "Rain_Night_Top.bmp", &skbx_Tex_Top );//<------ } } //******************************************************************* //*** DrawSkybox() - Fills the skybox vertex buffer with vertices *** //******************************************************************* //Directions: // //Make sure you have: // Called SetSkyboxState() // //Before you call DrawSkybox() // //All that has to be done is to call this and give the skybox a size. //The larger the size, the bigger the skybox turns out to be. void CEnvironment::DrawSkybox(float size) { skbx_Buffer->Lock( 0, 0, (BYTE**)&skbx_Vertices, 0 ); //First side RIGHT skbx_Vertices[0].position = D3DXVECTOR3(size, size, size); skbx_Vertices[0].color = 0xffffffff; skbx_Vertices[0].tu = 0.0f; skbx_Vertices[0].tv = 0.0f; skbx_Vertices[1].position = D3DXVECTOR3(size, size, -size); skbx_Vertices[1].color = 0xffffffff; skbx_Vertices[1].tu = 0.0f; skbx_Vertices[1].tv = 1.0f; skbx_Vertices[2].position = D3DXVECTOR3(size, -size, -size); skbx_Vertices[2].color = 0xffffffff; skbx_Vertices[2].tu = 1.0f; skbx_Vertices[2].tv = 1.0f; skbx_Vertices[3].position = D3DXVECTOR3(size, size, size); skbx_Vertices[3].color = 0xffffffff; skbx_Vertices[3].tu = 0.0f; skbx_Vertices[3].tv = 0.0f; skbx_Vertices[4].position = D3DXVECTOR3(size, -size, -size); skbx_Vertices[4].color = 0xffffffff; skbx_Vertices[4].tu = 1.0f; skbx_Vertices[4].tv = 1.0f; skbx_Vertices[5].position = D3DXVECTOR3(size, -size, size); skbx_Vertices[5].color = 0xffffffff; skbx_Vertices[5].tu = 1.0f; skbx_Vertices[5].tv = 0.0f; //Second Side FRONT skbx_Vertices[6].position = D3DXVECTOR3(size, size, size); skbx_Vertices[6].color = 0xffffffff; skbx_Vertices[6].tu = 0.0f; skbx_Vertices[6].tv = 1.0f; skbx_Vertices[7].position = D3DXVECTOR3(size, -size, size); skbx_Vertices[7].color = 0xffffffff; skbx_Vertices[7].tu = 1.0f; skbx_Vertices[7].tv = 1.0f; skbx_Vertices[8].position = D3DXVECTOR3(-size, size, size); skbx_Vertices[8].color = 0xffffffff; skbx_Vertices[8].tu = 0.0f; skbx_Vertices[8].tv = 0.0f; skbx_Vertices[9].position = D3DXVECTOR3(-size, size, size); skbx_Vertices[9].color = 0xffffffff; skbx_Vertices[9].tu = 0.0f; skbx_Vertices[9].tv = 0.0f; skbx_Vertices[10].position = D3DXVECTOR3(size, -size, size); skbx_Vertices[10].color = 0xffffffff; skbx_Vertices[10].tu = 1.0f; skbx_Vertices[10].tv = 1.0f; skbx_Vertices[11].position = D3DXVECTOR3(-size, -size, size); skbx_Vertices[11].color = 0xffffffff; skbx_Vertices[11].tu = 1.0f; skbx_Vertices[11].tv = 0.0f; //Third Side LEFT skbx_Vertices[12].position = D3DXVECTOR3(-size, size, -size); skbx_Vertices[12].color = 0xffffffff; skbx_Vertices[12].tu = 0.0f; skbx_Vertices[12].tv = 0.0f; skbx_Vertices[13].position = D3DXVECTOR3(-size, -size, size); skbx_Vertices[13].color = 0xffffffff; skbx_Vertices[13].tu = 1.0f; skbx_Vertices[13].tv = 1.0f; skbx_Vertices[14].position = D3DXVECTOR3(-size, -size, -size); skbx_Vertices[14].color = 0xffffffff; skbx_Vertices[14].tu = 1.0f; skbx_Vertices[14].tv = 0.0f; skbx_Vertices[15].position = D3DXVECTOR3(-size, size, -size); skbx_Vertices[15].color = 0xffffffff; skbx_Vertices[15].tu = 0.0f; skbx_Vertices[15].tv = 0.0f; skbx_Vertices[16].position = D3DXVECTOR3(-size, -size, size); skbx_Vertices[16].color = 0xffffffff; skbx_Vertices[16].tu = 1.0f; skbx_Vertices[16].tv = 1.0f; skbx_Vertices[17].position = D3DXVECTOR3(-size, size, size); skbx_Vertices[17].color = 0xffffffff; skbx_Vertices[17].tu = 0.0f; skbx_Vertices[17].tv = 1.0f; //Fourth Side BACK skbx_Vertices[18].position = D3DXVECTOR3(-size, size, -size); skbx_Vertices[18].color = 0xffffffff; skbx_Vertices[18].tu = 0.0f; skbx_Vertices[18].tv = 1.0f; skbx_Vertices[19].position = D3DXVECTOR3(size, size, -size); skbx_Vertices[19].color = 0xffffffff; skbx_Vertices[19].tu = 0.0f; skbx_Vertices[19].tv = 0.0f; skbx_Vertices[20].position = D3DXVECTOR3(-size, -size, -size); skbx_Vertices[20].color = 0xffffffff; skbx_Vertices[20].tu = 1.0f; skbx_Vertices[20].tv = 1.0f; skbx_Vertices[21].position = D3DXVECTOR3(size, size, -size); skbx_Vertices[21].color = 0xffffffff; skbx_Vertices[21].tu = 0.0f; skbx_Vertices[21].tv = 0.0f; skbx_Vertices[22].position = D3DXVECTOR3(-size, -size, -size); skbx_Vertices[22].color = 0xffffffff; skbx_Vertices[22].tu = 1.0f; skbx_Vertices[22].tv = 1.0f; skbx_Vertices[23].position = D3DXVECTOR3(size, -size, -size); skbx_Vertices[23].color = 0xffffffff; skbx_Vertices[23].tu = 1.0f; skbx_Vertices[23].tv = 0.0f; //Fifth Side TOP skbx_Vertices[24].position = D3DXVECTOR3(size, size, size); skbx_Vertices[24].color = 0xffffffff; skbx_Vertices[24].tu = 1.0f; skbx_Vertices[24].tv = 1.0f; skbx_Vertices[25].position = D3DXVECTOR3(size, size, -size); skbx_Vertices[25].color = 0xffffffff; skbx_Vertices[25].tu = 0.0f; skbx_Vertices[25].tv = 1.0f; skbx_Vertices[26].position = D3DXVECTOR3(-size, size, -size); skbx_Vertices[26].color = 0xffffffff; skbx_Vertices[26].tu = 0.0f; skbx_Vertices[26].tv = 0.0f; skbx_Vertices[27].position = D3DXVECTOR3(size, size, size); skbx_Vertices[27].color = 0xffffffff; skbx_Vertices[27].tu = 1.0f; skbx_Vertices[27].tv = 1.0f; skbx_Vertices[28].position = D3DXVECTOR3(-size, size, -size); skbx_Vertices[28].color = 0xffffffff; skbx_Vertices[28].tu = 0.0f; skbx_Vertices[28].tv = 0.0f; skbx_Vertices[29].position = D3DXVECTOR3(-size, size, size); skbx_Vertices[29].color = 0xffffffff; skbx_Vertices[29].tu = 1.0f; skbx_Vertices[29].tv = 0.0f; //Sixth Side BOTTOM skbx_Vertices[30].position = D3DXVECTOR3(size, -size, size); skbx_Vertices[30].color = 0x000000ff; skbx_Vertices[30].tu = 0.0f; skbx_Vertices[30].tv = 0.0f; skbx_Vertices[31].position = D3DXVECTOR3(size, -size, -size); skbx_Vertices[31].color = 0x000000ff; skbx_Vertices[31].tu = 1.0f; skbx_Vertices[31].tv = 0.0f; skbx_Vertices[32].position = D3DXVECTOR3(-size, -size, -size); skbx_Vertices[32].color = 0x000000ff; skbx_Vertices[32].tu = 1.0f; skbx_Vertices[32].tv = 1.0f; skbx_Vertices[33].position = D3DXVECTOR3(size, -size, size); skbx_Vertices[33].color = 0x000000ff; skbx_Vertices[33].tu = 0.0f; skbx_Vertices[33].tv = 0.0f; skbx_Vertices[34].position = D3DXVECTOR3(-size, -size, -size); skbx_Vertices[34].color = 0x000000ff; skbx_Vertices[34].tu = 1.0f; skbx_Vertices[34].tv = 1.0f; skbx_Vertices[35].position = D3DXVECTOR3(-size, -size, size); skbx_Vertices[35].color = 0x000000ff; skbx_Vertices[35].tu = 0.0f; skbx_Vertices[35].tv = 1.0f; skbx_Buffer->Unlock(); } //**************************************************************** //*** RenderSkybox() - Renders and textures the current skybox *** //**************************************************************** //Directions: // //Make sure you have: // Called SetSkyboxState() // Called DrawSkybox() // //Before you call RenderSkybox. //Call RenderSkybox in the Render Function. void CEnvironment::RenderSkybox(){ DX->g_pd3dDevice->SetTexture(0, skbx_Tex_Right); DX->g_pd3dDevice->SetStreamSource( 0, skbx_Buffer, sizeof(CUSTOMVERTEX) ); DX->g_pd3dDevice->SetVertexShader( D3DFVF_CUSTOMVERTEX ); DX->g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 0, 6 ); DX->g_pd3dDevice->SetTexture(0, skbx_Tex_Front); DX->g_pd3dDevice->SetStreamSource( 0, skbx_Buffer, sizeof(CUSTOMVERTEX) ); DX->g_pd3dDevice->SetVertexShader( D3DFVF_CUSTOMVERTEX ); DX->g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 6, 6 ); DX->g_pd3dDevice->SetTexture(0, skbx_Tex_Left); DX->g_pd3dDevice->SetStreamSource( 0, skbx_Buffer, sizeof(CUSTOMVERTEX) ); DX->g_pd3dDevice->SetVertexShader( D3DFVF_CUSTOMVERTEX ); DX->g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 12, 6 ); DX->g_pd3dDevice->SetTexture(0, skbx_Tex_Back); DX->g_pd3dDevice->SetStreamSource( 0, skbx_Buffer, sizeof(CUSTOMVERTEX) ); DX->g_pd3dDevice->SetVertexShader( D3DFVF_CUSTOMVERTEX ); DX->g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 18, 6 ); DX->g_pd3dDevice->SetTexture(0, skbx_Tex_Top); DX->g_pd3dDevice->SetStreamSource( 0, skbx_Buffer, sizeof(CUSTOMVERTEX) ); DX->g_pd3dDevice->SetVertexShader( D3DFVF_CUSTOMVERTEX ); DX->g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 24, 6 ); DX->g_pd3dDevice->SetStreamSource( 0, skbx_Buffer, sizeof(CUSTOMVERTEX) ); DX->g_pd3dDevice->SetVertexShader( D3DFVF_CUSTOMVERTEX ); DX->g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 30, 6 ); } </script> And the CUSTOMVERTEX structure: <script> struct CUSTOMVERTEX { D3DXVECTOR3 position; // The position D3DCOLOR color; // The color FLOAT tu, tv; // The texture coordinates }; </script> Any help would be appreciated... Thanks, ~Griffyboy0~ [Edited by - griffyboy0 on October 24, 2004 4:37:56 PM]

Share this post


Link to post
Share on other sites
Advertisement
Hold on, I think I saw something amiss.
You seem to be doing some strange stuff there. :)

Some quick questions.

1) Can the skybox be loaded from one texture and rendered with one call ? That would limit alot of texture creation, SetTexture, DrawPrimitive calls. This of course for each phase for drawing. This would also ensure a single colour palette and texutre for each call.

2) Maybe you could copy the tu/tv co-ords from one side of the skybox to the others. Especially if a side actually works.

I will ponder your code further. ;)

Share this post


Link to post
Share on other sites
It looks like some of your vertex position and texture coordinates are in error

try these alterations:

skbx_Buffer->Lock( 0, 0, (BYTE**)&skbx_Vertices, 0 );
//First side RIGHT

skbx_Vertices[0].position = D3DXVECTOR3(size, size, size);
skbx_Vertices[0].color = 0xffffffff;
skbx_Vertices[0].tu = 0.0f;
skbx_Vertices[0].tv = 0.0f;

skbx_Vertices[1].position = D3DXVECTOR3(size, -size, -size);
skbx_Vertices[1].color = 0xffffffff;
skbx_Vertices[1].tu = 1.0f;
skbx_Vertices[1].tv = 1.0f;

skbx_Vertices[2].position = D3DXVECTOR3(size, -size, size);
skbx_Vertices[2].color = 0xffffffff;
skbx_Vertices[2].tu = 0.0f;
skbx_Vertices[2].tv = 1.0f;

skbx_Vertices[3].position = D3DXVECTOR3(size, size, size);
skbx_Vertices[3].color = 0xffffffff;
skbx_Vertices[3].tu = 0.0f;
skbx_Vertices[3].tv = 0.0f;

skbx_Vertices[4].position = D3DXVECTOR3(size, size, -size);
skbx_Vertices[4].color = 0xffffffff;
skbx_Vertices[4].tu = 1.0f;
skbx_Vertices[4].tv = 0.0f;

skbx_Vertices[5].position = D3DXVECTOR3(size, -size, -size);
skbx_Vertices[5].color = 0xffffffff;
skbx_Vertices[5].tu = 1.0f;
skbx_Vertices[5].tv = 1.0f;

//Second Side FRONT

skbx_Vertices[6].position = D3DXVECTOR3(size, size, -size);
skbx_Vertices[6].color = 0xffffffff;
skbx_Vertices[6].tu = 0.0f;
skbx_Vertices[6].tv = 0.0f;

skbx_Vertices[7].position = D3DXVECTOR3(-size, -size, -size);
skbx_Vertices[7].color = 0xffffffff;
skbx_Vertices[7].tu = 1.0f;
skbx_Vertices[7].tv = 1.0f;

skbx_Vertices[8].position = D3DXVECTOR3(size, -size, -size);
skbx_Vertices[8].color = 0xffffffff;
skbx_Vertices[8].tu = 0.0f;
skbx_Vertices[8].tv = 1.0f;

skbx_Vertices[9].position = D3DXVECTOR3(size, size, -size);
skbx_Vertices[9].color = 0xffffffff;
skbx_Vertices[9].tu = 0.0f;
skbx_Vertices[9].tv = 0.0f;

skbx_Vertices[10].position = D3DXVECTOR3(-size, size, -size);
skbx_Vertices[10].color = 0xffffffff;
skbx_Vertices[10].tu = 1.0f;
skbx_Vertices[10].tv = 0.0f;

skbx_Vertices[11].position = D3DXVECTOR3(-size, -size, -size);
skbx_Vertices[11].color = 0xffffffff;
skbx_Vertices[11].tu = 1.0f;
skbx_Vertices[11].tv = 1.0f;

//Third Side LEFT

skbx_Vertices[12].position = D3DXVECTOR3(-size, size, -size);
skbx_Vertices[12].color = 0xffffffff;
skbx_Vertices[12].tu = 0.0f;
skbx_Vertices[12].tv = 0.0f;

skbx_Vertices[13].position = D3DXVECTOR3(-size, -size, size);
skbx_Vertices[13].color = 0xffffffff;
skbx_Vertices[13].tu = 1.0f;
skbx_Vertices[13].tv = 1.0f;

skbx_Vertices[14].position = D3DXVECTOR3(-size, -size, -size);
skbx_Vertices[14].color = 0xffffffff;
skbx_Vertices[14].tu = 0.0f;
skbx_Vertices[14].tv = 1.0f;

skbx_Vertices[15].position = D3DXVECTOR3(-size, size, -size);
skbx_Vertices[15].color = 0xffffffff;
skbx_Vertices[15].tu = 0.0f;
skbx_Vertices[15].tv = 0.0f;

skbx_Vertices[16].position = D3DXVECTOR3(-size, size, size);
skbx_Vertices[16].color = 0xffffffff;
skbx_Vertices[16].tu = 1.0f;
skbx_Vertices[16].tv = 0.0f;

skbx_Vertices[17].position = D3DXVECTOR3(-size, -size, size);
skbx_Vertices[17].color = 0xffffffff;
skbx_Vertices[17].tu = 1.0f;
skbx_Vertices[17].tv = 1.0f;

//Fourth Side BACK

skbx_Vertices[18].position = D3DXVECTOR3(-size, size, size);
skbx_Vertices[18].color = 0xffffffff;
skbx_Vertices[18].tu = 0.0f;
skbx_Vertices[18].tv = 0.0f;

skbx_Vertices[19].position = D3DXVECTOR3(size, -size, size);
skbx_Vertices[19].color = 0xffffffff;
skbx_Vertices[19].tu = 1.0f;
skbx_Vertices[19].tv = 1.0f;

skbx_Vertices[20].position = D3DXVECTOR3(-size, -size, size);
skbx_Vertices[20].color = 0xffffffff;
skbx_Vertices[20].tu = 0.0f;
skbx_Vertices[20].tv = 1.0f;

skbx_Vertices[21].position = D3DXVECTOR3(-size, size, size);
skbx_Vertices[21].color = 0xffffffff;
skbx_Vertices[21].tu = 0.0f;
skbx_Vertices[21].tv = 0.0f;

skbx_Vertices[22].position = D3DXVECTOR3(size, size, size);
skbx_Vertices[22].color = 0xffffffff;
skbx_Vertices[22].tu = 1.0f;
skbx_Vertices[22].tv = 0.0f;

skbx_Vertices[23].position = D3DXVECTOR3(size, -size, size);
skbx_Vertices[23].color = 0xffffffff;
skbx_Vertices[23].tu = 1.0f;
skbx_Vertices[23].tv = 1.0f;

//Fifth Side TOP

skbx_Vertices[24].position = D3DXVECTOR3(-size, size, -size);
skbx_Vertices[24].color = 0xffffffff;
skbx_Vertices[24].tu = 0.0f;
skbx_Vertices[24].tv = 0.0f;

skbx_Vertices[25].position = D3DXVECTOR3(size, size, size);
skbx_Vertices[25].color = 0xffffffff;
skbx_Vertices[25].tu = 1.0f;
skbx_Vertices[25].tv = 1.0f;

skbx_Vertices[26].position = D3DXVECTOR3(-size, size, size);
skbx_Vertices[26].color = 0xffffffff;
skbx_Vertices[26].tu = 0.0f;
skbx_Vertices[26].tv = 1.0f;

skbx_Vertices[27].position = D3DXVECTOR3(-size, size, -size);
skbx_Vertices[27].color = 0xffffffff;
skbx_Vertices[27].tu = 0.0f;
skbx_Vertices[27].tv = 0.0f;

skbx_Vertices[28].position = D3DXVECTOR3(size, size, -size);
skbx_Vertices[28].color = 0xffffffff;
skbx_Vertices[28].tu = 1.0f;
skbx_Vertices[28].tv = 0.0f;

skbx_Vertices[29].position = D3DXVECTOR3(size, size, size);
skbx_Vertices[29].color = 0xffffffff;
skbx_Vertices[29].tu = 1.0f;
skbx_Vertices[29].tv = 1.0f;

//Sixth Side BOTTOM

skbx_Vertices[30].position = D3DXVECTOR3(-size, -size, size);
skbx_Vertices[30].color = 0x000000ff;
skbx_Vertices[30].tu = 0.0f;
skbx_Vertices[30].tv = 0.0f;

skbx_Vertices[31].position = D3DXVECTOR3(size, -size, -size);
skbx_Vertices[31].color = 0x000000ff;
skbx_Vertices[31].tu = 1.0f;
skbx_Vertices[31].tv = 1.0f;

skbx_Vertices[32].position = D3DXVECTOR3(-size, -size, -size);
skbx_Vertices[32].color = 0x000000ff;
skbx_Vertices[32].tu = 0.0f;
skbx_Vertices[32].tv = 1.0f;

skbx_Vertices[33].position = D3DXVECTOR3(-size, -size, size);
skbx_Vertices[33].color = 0x000000ff;
skbx_Vertices[33].tu = 0.0f;
skbx_Vertices[33].tv = 0.0f;

skbx_Vertices[34].position = D3DXVECTOR3(size, -size, size);
skbx_Vertices[34].color = 0x000000ff;
skbx_Vertices[34].tu = 1.0f;
skbx_Vertices[34].tv = 0.0f;

skbx_Vertices[35].position = D3DXVECTOR3(size, -size, -size);
skbx_Vertices[35].color = 0x000000ff;
skbx_Vertices[35].tu = 1.0f;
skbx_Vertices[35].tv = 1.0f;

skbx_Buffer->Unlock();




HTH,
Cambo_frog

Share this post


Link to post
Share on other sites
I'll look into that now. I'll try out the new texture coords that Cambo_Frog gave, and I'll answer Arion's questions now.

I dont even know what I would have to do to texture the entire box with one texture.

I was thinking about making an X file and just loading that, but that is more costly on resources last time I checked...

I made a previous version of the program that used pretty much the same code, but worked. I altered the texture and position coords for the box though, as a new axis is considered to be up in this version...

I've tried only rendering certian sides to see if any of them texture correctly, but as of yet, none of them texture correctly, and the closest one only worked on half of the quad (or one of the triangles :-P).

I'll try the new texture and position coords that Cambo_Frog gave me now.

Thanks for the help so far,
~Griffyboy0~

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!