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

  • Home
  • SEARCH
  • 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 7745265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:58:13+00:00 2026-06-01T09:58:13+00:00

So, i have a problem with my engine that i am working on right

  • 0

So, i have a problem with my engine that i am working on right now:

img

The point is, that it should generate 16×16 platform of them.

This is code that creates cubes:

 private void render(){



        GL11.glClear(GL11.GL_COLOR_BUFFER_BIT|GL11.GL_DEPTH_BUFFER_BIT);
        for(int x=0; x<16; x++){
            for(int z=0; z<16; z++) {


                b.renderBlock(x, 0, z, texture);

            }
        }

        glMatrixMode( GL_MODELVIEW );
        GL11.glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
        GL11.glEnable(GL_CULL_FACE);
        GL11.glLoadIdentity();

    }

This should render 16×16 platform of blocks

Block.java (b.renderblock)

package net.themorfeus.awesum.adventure.game;

import org.lwjgl.opengl.GL11;
import org.newdawn.slick.opengl.Texture;

public class Block {

    private float rquad = 0f;

    public void renderBlock(int posx, int posy, int posz, Texture t) {
        t.bind();
        //GL11.glLoadIdentity();                          // Reset The Current Modelview Matrix
        GL11.glTranslatef(posx,posy,posz);             // Move Right 1.5 Units And Into The Screen 6.0
        GL11.glRotatef(rquad,0.0f,0.0f,1.0f);               // Rotate The Quad On The X axis ( NEW )
        GL11.glColor3f(1.0f,1.0f,1.0f);                 // Set The Color To Blue One Time Only
        GL11.glBegin(GL11.GL_QUADS);                  // Draw A Quad
      //GL11.glColor3f(0.5f, 0.4f, 0.4f);             // Set The Color To Green
        GL11.glTexCoord2f(0,0);
        GL11.glVertex3f( 1f, 1f,-1f);         // Top Right Of The Quad (Top)
        GL11.glTexCoord2f(1,0);
        GL11.glVertex3f(-1f, 1f,-1f);         // Top Left Of The Quad (Top)
        GL11.glTexCoord2f(1,1);
        GL11.glVertex3f(-1f, 1f, 1f);         // Bottom Left Of The Quad (Top)
        GL11.glTexCoord2f(0,1);
        GL11.glVertex3f( 1f, 1f, 1f);         // Bottom Right Of The Quad (Top)

        //GL11.glColor3f(1.2f,0.5f,0.9f);             // Set The Color To Orange
        GL11.glTexCoord2f(0,0);
        GL11.glVertex3f( 1f,-1f, 1f);         // Top Right Of The Quad (Bottom)
        GL11.glTexCoord2f(0,1);
        GL11.glVertex3f(-1f,-1f, 1f);         // Top Left Of The Quad (Bottom)
        GL11.glTexCoord2f(1,1);
        GL11.glVertex3f(-1f,-1f,-1f);         // Bottom Left Of The Quad (Bottom)
        GL11.glTexCoord2f(1,0);
        GL11.glVertex3f( 1f,-1f,-1f);         // Bottom Right Of The Quad (Bottom)

        //GL11.glColor3f(1.0f,0.0f,0.0f);             // Set The Color To Red
        GL11.glTexCoord2f(0,0);
        GL11.glVertex3f( 1f, 1f, 1f);         // Top Right Of The Quad (Front)
        GL11.glTexCoord2f(1,0);
        GL11.glVertex3f(-1f, 1f, 1f);         // Top Left Of The Quad (Front)
        GL11.glTexCoord2f(1,1);
        GL11.glVertex3f(-1f,-1f, 1f);         // Bottom Left Of The Quad (Front)
        GL11.glTexCoord2f(0,1);
        GL11.glVertex3f( 1f,-1f, 1f);         // Bottom Right Of The Quad (Front)

        //GL11.glColor3f(1f,0.5f,0.0f);             // Set The Color To Yellow
        GL11.glTexCoord2f(0,0);
        GL11.glVertex3f( 1f,-1f,-1f);         // Bottom Left Of The Quad (Back)
        GL11.glTexCoord2f(1,0);
        GL11.glVertex3f(-1f,-1f,-1f);         // Bottom Right Of The Quad (Back)
        GL11.glTexCoord2f(1,1);
        GL11.glVertex3f(-1f, 1f,-1f);         // Top Right Of The Quad (Back)
        GL11.glTexCoord2f(0,1);
        GL11.glVertex3f( 1f, 1f,-1f);         // Top Left Of The Quad (Back)

        //GL11.glColor3f(0.0f,0.0f,0.3f);             // Set The Color To Blue
        GL11.glTexCoord2f(0,1);
        GL11.glVertex3f(-1f, 1f, 1f);         // Top Right Of The Quad (Left)
        GL11.glTexCoord2f(1,1);
        GL11.glVertex3f(-1f, 1f,-1f);         // Top Left Of The Quad (Left)
        GL11.glTexCoord2f(1,0);
        GL11.glVertex3f(-1f,-1f,-1f);         // Bottom Left Of The Quad (Left)
        GL11.glTexCoord2f(0,0);
        GL11.glVertex3f(-1f,-1f, 1f);         // Bottom Right Of The Quad (Left)

        //GL11.glColor3f(0.5f,0.0f,0.5f);             // Set The Color To Violet
        GL11.glTexCoord2f(0,0);
        GL11.glVertex3f( 1f, 1f,-1f);         // Top Right Of The Quad (Right)
        GL11.glTexCoord2f(1,0);
        GL11.glVertex3f( 1f, 1f, 1f);         // Top Left Of The Quad (Right)
        GL11.glTexCoord2f(1,1);
        GL11.glVertex3f( 1f,-1f, 1f);         // Bottom Left Of The Quad (Right)
        GL11.glTexCoord2f(0,1);
        GL11.glVertex3f( 1f,-1f,-1f);         // Bottom Right Of The Quad (Right)
        GL11.glEnd();
        //rquad+=0.0000001f;

    }




}

It basically renders the block quads.

  • 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-01T09:58:14+00:00Added an answer on June 1, 2026 at 9:58 am

    You shoud surround your drawing/translation with a glPushMatrix–glPopMatrix pair.

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

Sidebar

Related Questions

I am working on game engine prototype and have the following question: Right now
I have a TYPO3 site with Indexed Search Engine extension... The problem is that
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
my actual problem is that .live() jQuery method is not working. This si the
I have a problem with the Google App Engine JDO implementation that I cannot
At work, I have started working on a program that can potentially generate hundreds
I am working on a project right now that involves receiving a message from
I've got a lot of code that's driving me really crazy right now. I'm
Ok, here's a problem I'm having. I have Lua bindings to a rendering engine
I have problem in some JavaScript that I am writing where the Switch statement

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.