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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:38:57+00:00 2026-06-10T00:38:57+00:00

In my program I am rendering a simple triangle and a textured cube, Individually

  • 0

In my program I am rendering a simple triangle and a textured cube, Individually both work fine but when i call the respective draw methods together , the texturing of cube doesn’t show.

The onSurfaceCreated function is as shown below:

public void onSurfaceCreated(GL10 gl, EGLConfig eglConfig) {
        cub.loadGLTexture(gl, this.context);
        //gl.glEnable(GL10.GL_TEXTURE_2D);            
        gl.glShadeModel(GL10.GL_SMOOTH);            
        gl.glClearColor(0.5f, 0.5f, 0.5f, 0.5f);    
        gl.glClearDepthf(1.0f);                    
        gl.glEnable(GL10.GL_DEPTH_TEST);           
        gl.glDepthFunc(GL10.GL_LEQUAL);            
        gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST); 
}

The onDrawFrame is as shown below:

public void onDrawFrame(GL10 gl) {
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
    gl.glMatrixMode(GL10.GL_MODELVIEW);
    gl.glLoadIdentity();
    GLU.gluLookAt(gl, 0, 0, -5, 0, 0, 0, 0, 2, 0);
    tri.draw(gl);       
    gl.glRotatef(-90, 1, 0, 0);
    gl.glTranslatef(-6, 0, 0);
    cub.draw(gl); 
}
  • 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-10T00:38:58+00:00Added an answer on June 10, 2026 at 12:38 am

    I got the answer. Actually i just had to clear the color of the 2D model before binding the 3D model to its texture.Thanks everyone.

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

Sidebar

Related Questions

I have a simple OpenGL program and trying to draw an instanced array that
Right now I am writing a program in OpenGl. I'm rendering some-what complex 3D
I am trying to add some post-processing capabilities to a program. The rendering is
Program runs once and it both throws data to the pipe and gets it
i did a text rendering program using UIView and UITableViewController. What i did is
I would like to know the OpenGL Rendering settings for having a program render
There is very simple task I want to do, that somehow makes the program
This is for a Terrain Generation and rendering program. I have a loop that
I am messing around in a program that performs all rendering using a matrix
I use in my program PNG images with gradients. Images look fine in design

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.