Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6234367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:28:23+00:00 2026-05-24T10:28:23+00:00

I recently switched from intermediate mode and have a new rendering process. There must

  • 0

I recently switched from intermediate mode and have a new rendering process. There must be something I am not understanding. I think it has something to do with the indices.

Here is my diagram: Region->Mesh->Polygon Array->3 vertex indices which references the master list of vertices.

Here my render code:

// Render the mesh
void WLD::render(GLuint* textures, long curRegion, CFrustum cfrustum)
{

    int num = 0;

    // Set up rendering states
    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);

    // Set up my indices
    GLuint indices[3];

    // Cycle through the PVS
    while(num < regions[curRegion].visibility.size())
    {
        int i = regions[curRegion].visibility[num];

        // Make sure the region is not "dead"
        if(!regions[i].dead && regions[i].meshptr != NULL)
        {
            // Check to see if the mesh is in the frustum
            if(cfrustum.BoxInFrustum(regions[i].meshptr->min[0], regions[i].meshptr->min[2], regions[i].meshptr->min[1], regions[i].meshptr->max[0], regions[i].meshptr->max[2], regions[i].meshptr->max[1]))
            {
                // Cycle through every polygon in the mesh and render it
                for(int j = 0; j < regions[i].meshptr->polygonCount; j++)
                {   
                    // Assign the index for the polygon to the index in the huge vertex array
                    // This I think, is redundant
                    indices[0] = regions[i].meshptr->poly[j].vertIndex[0];
                    indices[1] = regions[i].meshptr->poly[j].vertIndex[1];
                    indices[2] = regions[i].meshptr->poly[j].vertIndex[2];

                    // Enable texturing and bind the appropriate texture
                    glEnable(GL_TEXTURE_2D);
                    glBindTexture(GL_TEXTURE_2D, textures[regions[i].meshptr->poly[j].tex]);

                    glVertexPointer(3, GL_FLOAT, sizeof(Vertex), &vertices[0].x);

                    glTexCoordPointer(2, GL_FLOAT, sizeof(Vertex), &vertices[0].u);

                    // Draw
                    glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, indices);
                }
            }
        }
    num++;
    }

    // End of rendering - disable states
    glDisableClientState(GL_VERTEX_ARRAY);
    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}

Sorry if I left anything out. And I really appreciate feedback and help with this. I would even consider paying someone who is good with OpenGL and optimization to help me with this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T10:28:24+00:00Added an answer on May 24, 2026 at 10:28 am

    There is no point in using array rendering if you’re only rendering 3 vertices at a time. The idea is to send thousands through with a single call. That is, you render a single “Polygon Array” or “Mesh” with one call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We just recently switched from Visual Studio 2008 to Visual Studio 2010. I have
We have a WCF service that we recently switched from self-hosting to IIS-hosted. It
I recently switched from Eclipse to NetBeans (although I don't have any current Eclipse
We have a C# application written in C# and recently switched over from MbUnit
I have recently switched back to IntelliJ from Eclipse and one thing I am
I recently switched from MVC2 to MVC3 and my images are no longer rendering
I have recently switched from using Eclipse to IntelliJ, and am preferring the experience.
I have recently switched from python 2.7 to python 3.2 considering following folder structure:
I have recently switched from C# to JAVA, although I have a few questions.
I have recently switched from using separate resource files to using a texture atlas.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.