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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:50:32+00:00 2026-06-06T06:50:32+00:00

If I switch GL_QUADS to GL_TRIANGLES and remove the last point, the triangle renders

  • 0

If I switch GL_QUADS to GL_TRIANGLES and remove the last point, the triangle renders fine.
However, changing it back to GL_QUADS and adding another point just leaves me with a black screen. So what do I do?

import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.glu.GLU;

public class Main {
public Main() {
    this.start();
}

private void start() {  
    try {
        Display.setDisplayMode(new DisplayMode(640,640));
        Display.setTitle("FPSTest");
        Display.create();
    } catch (LWJGLException e) {
        e.printStackTrace();
    }
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glLoadIdentity();
    GL11.glOrtho(-10, 10, -10, 10, -1000, 1000);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    while (!Display.isCloseRequested()) {
        GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT|GL11.GL_COLOR_BUFFER_BIT);
        GL11.glRotatef(0, 1, 1, 1);
        GL11.glBegin(GL11.GL_QUADS);
//          GL11.glBegin(GL11.GL_TRIANGLES);
        {
            GL11.glColor3f(1.0f, 0.0f, 0.0f);
            GL11.glVertex3f(0.0f, 3.0f, 0.0f);
            GL11.glColor3f(0.0f, 1.0f, 0.0f);
            GL11.glVertex3f(0.0f, 0.0f, -3.0f);
            GL11.glColor3f(0.0f, 0.0f, 1.0f);
            GL11.glVertex3f(3.0f, 0.0f, 0.0f);
            GL11.glColor3f(0.0f, 1.0f, 0.0f);
            GL11.glVertex3f(0.0f, 0.0f, 3.0f);
        }
        GL11.glEnd();
        GL11.glLoadIdentity();
        Display.update();
    }

    Display.destroy();
}

public static void main(String[] argv) {
    new Main();
}

}
  • 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-06-06T06:50:34+00:00Added an answer on June 6, 2026 at 6:50 am

    The vertices of a quad must be coplanar. The four vertices you specified are not, and according to this, the results are undefined in this case (which is probably the reason for the blank screen).

    Here’s a tool to help you find the plane equation, so you can choose a coplanar 4th point. Your first 3 points form the equation -9x -9y +9z + 27 = 0, so one example of a suitable point is:

    GL11.glVertex3f(2.0f, 2.0f, 1.0f);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code fully working under graphics card OpenGL. However when I switch to
Is context switch a O(1) process or the context switch quantum is dependent on
How do people switch fixed elements when scrolling down the page? Here's a perfect
I want to switch a file upload from FTP to SFTP. But I cannot
I know that switch / select statements break automatically after every case. I am
So in C# the switch statement only supports integral types (not Guids), so a
How do I switch the database that my entity model is connected to at
I want to switch images on .click() using the url attr I can do
I have a switch case statement that doesn't work. I've checked the input, it's
I am starting to switch over my Controllers to use model binders for GET

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.