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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:29:57+00:00 2026-06-14T21:29:57+00:00

I am building a simple Wavefront Obj file loader and renderer in Java, using

  • 0

I am building a simple Wavefront Obj file loader and renderer in Java, using JOGL. However, whenever I am loading a simple bunny test mesh, it’s rendering in a glitchy fashion, and I have no idea what could be causing it. I am just using geometry vertices and normals, no textures or materials.

the experienced glitch

another angle of that glitch

The following is the GL initialization code from the init() method:

gl.setSwapInterval(1);
gl.glClearColor(0.2f, 0.2f, 0.2f, 1.0f);        
gl.glEnable(GL2.GL_DEPTH_TEST);
gl.glDepthFunc(GL2.GL_LESS);
gl.glEnable(GL2.GL_CULL_FACE);
gl.glCullFace(GL2.GL_BACK);
gl.glShadeModel(GL2.GL_SMOOTH);
gl.glClearDepth(1.0d);

And this is the method that I’m using to render the model (fixed pipeline, for now):

 gl.glBegin(GL2.GL_TRIANGLES);
    for(Face face : master.faces) {
        for(int i = 0; i < face.points.length; i++) {
            gl.glNormal3f(face.normals[i].x, face.normals[i].y, face.normals[i].z);             
            gl.glVertex3f(face.points[i].x, face.points[i].y, face.points[i].z);
        }
    }
    gl.glEnd();

Where master is the main “group” that contains all the faces and vertices. I’ve checked – everything goes into the master group, and glNormal3f and glVertex3f get called for every needed vertex in every triangle.

Can anyone tell what could be causing those glitches?

Edit 1:

Here is the code I’m using to set the projection and modelview matrices up:

float aspect = (float) width / (float) height;

gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glLoadIdentity();

glu.gluPerspective(60.0f, aspect, 0.01f, 100.0f);
glu.gluLookAt(2.0f, 1.0f, 1.5f,
        0.0f, 0.0f, 0.0f,
        0.0f, 1.0f, 0.0f);

gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glLoadIdentity();
  • 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-14T21:29:58+00:00Added an answer on June 14, 2026 at 9:29 pm

    Well, it seemed like this was being caused by a silly little bug in my object loader.
    When parsing my input vertices, it would chomp the first character of all the x coordinates of the geometry vertices. This didn’t affect the positive values, since they were all normalized and 0.43 = .43, but it messed up all negative values causing them to be interpreted as positive.

    It took me a while to figure that out, but I eventually found it and it just goes to show that the tiniest errors can be incredibly tricky to track down.

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

Sidebar

Related Questions

I'm building a simple web application in tornado.web using mongodb as the backend. 90%
I'm building a simple search table (eventually using jquery Datatables) for our knowledgebase. I'm
I am building a simple java/android application, and am trying to change the value
I am building simple blogging framework using PHP and MySQL, and on the add
If you are building a simple website using just simple HTML/CSS/Javascript that has say
I'm building a simple API using django-tastypie. The idea is I have two resources:
I am building a simple test to display product for a user. My spec
I'm building a simple Contact Management app with Crud using AngularJS 1.0.0rc8. Getting a
I'm building simple dictionary application using WPF. I'm using MVVM pattern, databinding and FlowDocument
I'm building a simple chat server in java , where users can have private

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.