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 7015495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:39:34+00:00 2026-05-27T22:39:34+00:00

I am using GL_TRIANGLE_STRIP to draw my terrain to the screen, however when I

  • 0

I am using GL_TRIANGLE_STRIP to draw my terrain to the screen, however when I compile and run the program I get nothing. When I change GL_TRIANGLE_STRIP to GL_LINES it shows up and works. What can I do to get it working with GL_TRIANGLE_STRIP?

void drawScene() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0f, 0.0f, -10.0f);
glRotatef(30.0f, 1.0f, 0.0f, 0.0f);
glRotatef(-_angle, 0.0f, 1.0f, 0.0f);

GLfloat ambientColor[] = {.5, .5, .5, 1.0f};
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambientColor);
float scale = 5.0f / max(63.0,63.0);
glScalef(scale, scale*10, scale);
glTranslatef(-(float)(63.0) / 2, 0.0f, -(float)(63.0) / 2);
     /*GLfloat lightColor0[] = {0.6f, 0.6f, 0.6f, 1.0f};
     GLfloat lightPos0[] = {-0.5f, 4, 32, 0.0f};
     glLightfv(GL_LIGHT0, GL_DIFFUSE, lightColor0);
     glLightfv(GL_LIGHT0, GL_POSITION, lightPos0);*/



glColor3f(0.3f, 0.9f, 0.0f);
for(int x = 0;x<64;x++){
    glBegin(GL_LINES);
    for(int z = 0;z<63;z++){
        glNormal3f(0,1,0);
        Vertex(x,map[x][z],z);
        Vertex(x,map[x][z+1],z+1);
    }
    glEnd();
}
for(int z = 0;z<64;z++){
    glBegin(GL_LINES);
    for(int x = 0;x<63;x++){
        Vertex(x,map[x][z],z);
        Vertex(x+1,map[x+1][z],z);
    }
    glEnd();
}

I’m not sure this is important but for my terrain I have code that makes it a 3d Gaussian distribution.

  • 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-27T22:39:34+00:00Added an answer on May 27, 2026 at 10:39 pm

    An explanation of TRIANGLE_STRIP is found by a Google search. There is an illustration on Wikipedia.

    My advice is to print out the first five vertices of your vertex data, and draw it by hand on paper. The fact that GL_LINES work suggest that the right vertices are there, you might just drawing them in the wrong order.

    Another piece of advice is to disable backface culling.

    glDisable(GL_CULL_FACE);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a 3D cube created using GL_TRIANGLE_STRIP.Is it possible to draw points(using GL_POINTS)
When I run my program on an emulator, it displays an ImageView splash screen,
So I do know how to draw multiple triangles using glBegin(GL_TRIANGLE_STRIPS) . What I
I'm using LWJGL. I'm trying to create a simple 3D map using GL_TRIANGLE_STRIP and
I have a problem using opengl on android to draw a simple rectangle. This
I'd like to render a full-screen aligned mesh using TRIANGLE_STRIP s. It consists of
When using glBegin() and glEnd() in opengl you are able to set and change
Basically, I'm doing some sort of image processing using a screen-sized rectangle made of
I'm trying to render a grid of texture using glDrawArray and GL_TRIANGLE_STRIP, but there
I have a simple OpenGL program and trying to draw an instanced array that

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.