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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:21:47+00:00 2026-05-16T03:21:47+00:00

In the context of a Java/OpenGL application I am drawing a black wired only

  • 0

In the context of a Java/OpenGL application I am drawing a black wired only (without filling) big cube composed of 27 smaller cubes. To do that I wrote the following code:

for (int x = 1; x <= 3; x++) {
    for (int y = 1; y <= 3; y++) {
        for (int z = 1; z <= 3; z++) {
            wireCube(x - 2, 2 - y, 2 - z);
         }
    }
}

The wireCube method is implemented using GL11.glBegin(GL11.GL_LINE_LOOP);

Using the right call to gluPerspective to define the projection and the correct call to gluLookAt to position the “camera” I am able to display my big cube as needed and ….I am very happy with that !!!

My new problem is now, how to modify this code in order to “hide” all the wirings that are inside the big cube ? To help visualize the scene, these wirings are the ones that are usually drawn has dashed lines when learning 3D geometry at school.

Thanks in advance for help

Manu

  • 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-16T03:21:47+00:00Added an answer on May 16, 2026 at 3:21 am

    Enable depth testing (glEnable(GL_DEPTH_TEST)) and put quads on the surfaces of the cubes.

    To draw a quad, use glBegin(GL_QUADS) followed by the four vertices and the glEnd() call.

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

Sidebar

Related Questions

Always in the context of a Rubik's cube app in Java/Opengl with lwjgl, i
Context: A Java client-side application needs to access a server-side MySQL database. Need: Limit
What is the difference between a Thread and a Process in the Java context?
Context I am storing a java.util.List inside ehcache. Key(String) --> List<UserDetail> The ordered List
Context I have this piece of Java Code btn.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent
Description: If we use java objects jruby get permgen too: System.out.println(Initialazing..); //Spring applicaton context
$ javac TestFilter.java TestFilter.java:19: non-static variable this cannot be referenced from a static context
I want to replace the first context of web/style/clients.html with the java String.replaceFirst method
I am trying to determine the impact of context switching on my Java thread.
This question has been asked in a C++ context but I'm curious about Java.

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.