Jump to content
  • Advertisement
Sign in to follow this  
officialhopsof

Faces not showing up

This topic is 3635 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 have this situation: Fill and in wirefram: Wireframe Now, as you can see, in the filled one, there are holes showing up, but in the wire frame one, everything seems like it should be. I have face culling disabled, and I am using:
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);



does anyone know what may be going wrong here? Just a nudge in the right direction would be fantastic. Thank you, Brandon

Share this post


Link to post
Share on other sites
Advertisement

while(!fileParser.atEnd())
{
int shape = fileParser.next();
int points;

if (shape == GL_TRIANGLES) {points = 3;}
else if (shape == GL_QUADS) {points = 4;}


glBegin(shape);

for(int i = 0; i < points; i++)
{
glColor3f(fileParser.next(), fileParser.next(), fileParser.next());
glVertex3f(fileParser.next()*scale, fileParser.next()*scale, fileParser.next()*scale);
}

}
fileParser.restart();
glEnd();



fileParser just stores the colors/vertices in order

Share this post


Link to post
Share on other sites
I just realized my error when i typed that up.


while(!fileParser.atEnd())
{
int shape = fileParser.next();
int points;

if (shape == GL_TRIANGLES) {points = 3;}
else if (shape == GL_QUADS) {points = 4;}


glBegin(shape);

for(int i = 0; i < points; i++)
{
glColor3f(fileParser.next(), fileParser.next(), fileParser.next());
glVertex3f(fileParser.next()*scale, fileParser.next()*scale, fileParser.next()*scale);
}
glEnd(); //and put it here
}
fileParser.restart();
//Move glEnd(); from here



its amazing how such simple things can be so hard to find, but when you take a step back and look at them they become obvious.

Thank you for your help,
Brandon

Share this post


Link to post
Share on other sites
It looks like you read a file and as you read it you render it.
That's not quite normal. Read the data and store the colors and vertices in an array and then render.

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!