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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:10:44+00:00 2026-05-25T13:10:44+00:00

The following code is the method to render a single cube in my JOGL

  • 0

The following code is the method to render a single cube in my JOGL practice app:

        public void render(GL gl)
        {
            texture.enable();

            gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);

            texture.bind(); // textures clockwise from top left when
            // facing

            gl.glBegin(GL.GL_QUADS);

            // north facing side
            if (renderSide[0])
                {
                    gl.glNormal3i(0, 1, 0);
                    gl.glTexCoord2f(0.0f, 0.0f);
                    gl.glVertex3fv(v2, 0);
                    gl.glTexCoord2f(1.0f, 0.0f);
                    gl.glVertex3fv(v1, 0);
                    gl.glTexCoord2f(1.0f, 1.0f);
                    gl.glVertex3fv(v5, 0);
                    gl.glTexCoord2f(0.0f, 1.0f);
                    gl.glVertex3fv(v6, 0);
                }
            // east facing side
            if (renderSide[1])
                {
                    gl.glNormal3i(1, 0, 0);
                    gl.glTexCoord2f(0.0f, 0.0f);
                    gl.glVertex3fv(v3, 0);
                    gl.glTexCoord2f(1.0f, 0.0f);
                    gl.glVertex3fv(v2, 0);
                    gl.glTexCoord2f(1.0f, 1.0f);
                    gl.glVertex3fv(v6, 0);
                    gl.glTexCoord2f(0.0f, 1.0f);
                    gl.glVertex3fv(v7, 0);
                }
            // south facing side
            if (renderSide[2])
                {
                    gl.glNormal3i(0, -1, 0);
                    gl.glTexCoord2f(0.0f, 0.0f);
                    gl.glVertex3fv(v4, 0);
                    gl.glTexCoord2f(1.0f, 0.0f);
                    gl.glVertex3fv(v3, 0);
                    gl.glTexCoord2f(1.0f, 1.0f);
                    gl.glVertex3fv(v7, 0);
                    gl.glTexCoord2f(0.0f, 1.0f);
                    gl.glVertex3fv(v8, 0);
                }
            // west facing side
            if (renderSide[3])
                {
                    gl.glNormal3i(-1, 0, 0);
                    gl.glTexCoord2f(0.0f, 0.0f);
                    gl.glVertex3fv(v1, 0);
                    gl.glTexCoord2f(1.0f, 0.0f);
                    gl.glVertex3fv(v4, 0);
                    gl.glTexCoord2f(1.0f, 1.0f);
                    gl.glVertex3fv(v8, 0);
                    gl.glTexCoord2f(0.0f, 1.0f);
                    gl.glVertex3fv(v5, 0);
                }
            // top side
            if (renderSide[4])
                {
                    gl.glNormal3i(0, 0, 1);
                    gl.glTexCoord2f(0.0f, 0.0f);
                    gl.glVertex3fv(v1, 0);
                    gl.glTexCoord2f(1.0f, 0.0f);
                    gl.glVertex3fv(v2, 0);
                    gl.glTexCoord2f(1.0f, 1.0f);
                    gl.glVertex3fv(v3, 0);
                    gl.glTexCoord2f(0.0f, 1.0f);
                    gl.glVertex3fv(v4, 0);
                }

            gl.glEnd();
            texture.disable();

This code is called for every Cube, which are each initialised identically, however the texture for some is treated differently and ‘blurred’, while the rest are not,

Here is an image:
Top left is wrong!!

This render method is called every frame for each block, so how is it that the problem manifest’s itself for a single block permanently?

Also as a side question, my app as it is has a substantial memory leak I cannot track down, is the problem here? other than setting the camera and light sources this is the majority of the OpenGL code!

  • 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-25T13:10:45+00:00Added an answer on May 25, 2026 at 1:10 pm

    GL_TEXTURE_MAG_FILTER is per-texture-object state. Bind your texture object, then set it.

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

Sidebar

Related Questions

I have the following code (calling a method returning IEnumerable): FibonacciWithLinq.Skip(delegate() { return 5;
The following code examines the behaviour of the float() method when fed a non-ascii
The following code says that passing the map as const into the operator[] method
In the ContainsIngredients method in the following code, is it possible to cache the
Given the following code snippet from inside a method; NSBezierPath * tempPath = [NSBezierPath
I have the following code which works just fine when the method is POST,
I have the following code at the head of a method: BigInteger foo =
In the following code, i have a method to get a Vector of persons
Is there a better/shorter way to write the whoAmI method in the following code?
Following some code in Agile Web Development book, theres a method to redirect back

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.