Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actual___

Posted 22 July 2013 - 01:59 PM

can you show your drawing code?

maybe you dont have properly closed last face? (2 or 1 vertex instead of 3)

VAO? i use VAO too but i dont have something like glgenbuffers etc

i have just simple array that is drawn like:

 

 

void __fastcall TachoGLModel::DrawModelVBO(t3dpoint punkt)
{
if (ModelCanBeUsed == false) return;

glVertexPointer(3, GL_FLOAT, sizeof(t3dpoint), &VBO_V[0]);
glNormalPointer(GL_FLOAT, sizeof(t3dpoint),&VBO_N[0]);
glTexCoordPointer(2, GL_FLOAT, sizeof(textpoint),&VBO_T[0]);
if (USE_COLOR_MAP == true) {

glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(4, GL_FLOAT, 0, &VBO_C[0]);

}

int i,j;


if (Textures.Length == 0) {
for (i = 0; i < Matrixarr.Length; i++)
glDrawArrays(matrixtogl(Matrixarr[i]), VBO_BE[i].INDEX_START , VBO_BE[i].length);
// FCyfra->ProjectTextures

if (USE_COLOR_MAP == true) glDisableClientState(GL_COLOR_ARRAY);
return;
}
//if( Textures.Length == 0) ShowMessage("NO");

for (i = 0; i < Matrixarr.Length; i++) {
//if (classifyapointagainstaplane(punkt,VBO_N[VBO_BE[i].INDEX_START],FACE_DISTANCE[i]) == isFront) {
if (EditMode == false)
if (Textures[Textureindex[i]].ID != 2)
if (Textures[Textureindex[i]].ID != 1) {
//


if ( Textures.Length > 0 )
glBindTexture(GL_TEXTURE_2D, Textures[ Textureindex[i] ].pointer);

glDrawArrays(matrixtogl(Matrixarr[i]), VBO_BE[i].INDEX_START , VBO_BE[i].length);


}


if (EditMode == true) glDrawArrays(matrixtogl(Matrixarr[i]), VBO_BE[i].INDEX_START , VBO_BE[i].length);
}


glEnable(GL_BLEND);
glDepthMask(GL_FALSE);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
if (EditMode == true)
for (i = 0; i < Matrixarr.Length; i++)
if (Textures[Textureindex[i]].ID == 1) {
if(Textures.Length > 0)
glBindTexture(GL_TEXTURE_2D,Textures[Textureindex[i]].pointer);
glDrawArrays(matrixtogl(Matrixarr[i]), VBO_BE[i].INDEX_START , VBO_BE[i].length);




}
glDepthMask(GL_TRUE);
glDisable(GL_BLEND);


if (USE_COLOR_MAP == true) glDisableClientState(GL_COLOR_ARRAY);

}


 

 

 

 

 

 

 

 

 

 

 

 

show your vertex array and drawing routine with initialization of the VAO too


#1___

Posted 22 July 2013 - 01:59 PM

can you show your drawing code?

maybe you dont have properly closed last face? (2 or 1 vertex instead of 3)

VAO? i use VAO too but i dont have something like glgenbuffers etc

i have just simple array that is drawn like:

 

 

 

 

 

void __fastcall TachoGLModel::DrawModelVBO(t3dpoint punkt)
{
if (ModelCanBeUsed == false) return;

glVertexPointer(3, GL_FLOAT, sizeof(t3dpoint), &VBO_V[0]);
glNormalPointer(GL_FLOAT, sizeof(t3dpoint),&VBO_N[0]);
glTexCoordPointer(2, GL_FLOAT, sizeof(textpoint),&VBO_T[0]);
if (USE_COLOR_MAP == true) {

glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(4, GL_FLOAT, 0, &VBO_C[0]);

}

int i,j;


if (Textures.Length == 0) {
for (i = 0; i < Matrixarr.Length; i++)
glDrawArrays(matrixtogl(Matrixarr[i]), VBO_BE[i].INDEX_START , VBO_BE[i].length);
// FCyfra->ProjectTextures

if (USE_COLOR_MAP == true) glDisableClientState(GL_COLOR_ARRAY);
return;
}
//if( Textures.Length == 0) ShowMessage("NO");

for (i = 0; i < Matrixarr.Length; i++) {
//if (classifyapointagainstaplane(punkt,VBO_N[VBO_BE[i].INDEX_START],FACE_DISTANCE[i]) == isFront) {
if (EditMode == false)
if (Textures[Textureindex[i]].ID != 2)
if (Textures[Textureindex[i]].ID != 1) {
//


if ( Textures.Length > 0 )
glBindTexture(GL_TEXTURE_2D, Textures[ Textureindex[i] ].pointer);

glDrawArrays(matrixtogl(Matrixarr[i]), VBO_BE[i].INDEX_START , VBO_BE[i].length);


}


if (EditMode == true) glDrawArrays(matrixtogl(Matrixarr[i]), VBO_BE[i].INDEX_START , VBO_BE[i].length);
}


glEnable(GL_BLEND);
glDepthMask(GL_FALSE);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
if (EditMode == true)
for (i = 0; i < Matrixarr.Length; i++)
if (Textures[Textureindex[i]].ID == 1) {
if(Textures.Length > 0)
glBindTexture(GL_TEXTURE_2D,Textures[Textureindex[i]].pointer);
glDrawArrays(matrixtogl(Matrixarr[i]), VBO_BE[i].INDEX_START , VBO_BE[i].length);




}
glDepthMask(GL_TRUE);
glDisable(GL_BLEND);


if (USE_COLOR_MAP == true) glDisableClientState(GL_COLOR_ARRAY);

}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

show your vertex array and drawing routine with initialization of the VAO too


PARTNERS