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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:12:41+00:00 2026-06-04T08:12:41+00:00

I have an OpenGL ES object which I am trying to draw. The object

  • 0

I have an OpenGL ES object which I am trying to draw. The object has fairly large vertice values with the x and y co-ordinates lying between -30,000 and +30,000. The z values are between 2000 and -2000.

Can anybody advise me how I should be setting up my viewport ? I am using the following code :

public void onSurfaceChanged(GL10 gl, int width, int height) {
    //Define the view frustrum
    gl.glViewport(0, 0, width, height);
    gl.glMatrixMode(GL10.GL_PROJECTION);
    gl.glLoadIdentity();
    float ratio = (float)width/height;
    GLU.gluPerspective(gl, 45.0f, ratio, 1, 100f);
}

public void onDrawFrame (GL10 gl) {
    // Clear the screen to black.
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);

    //Position the model.
    gl.glMatrixMode(GL10.GL_MODELVIEW);
    gl.glLoadIdentity();
    gl.glTranslatef(0.0f, 0.0f, 0.0f);
    //gl.glScalef(0.000015f,0.000015f,0.000015f);

This compiles ok, but I cannot see my object at all.

Thank you.

  • 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-04T08:12:43+00:00Added an answer on June 4, 2026 at 8:12 am

    You probably can’t see it because your camera’s inside the object. Maybe try first scaling it by 0.001 to get it down to about 60 units across, translate it by -50 in the z direction (to get it to the middle of your z range), and see if it shows up then.

    Alternatively you could just make your z-range a lot bigger, and translate it by some -50,000 units in the z direction to move the object back from the camera. You’ll have to adjust znear/zfar then to be much larger.

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

Sidebar

Related Questions

I have a textured object in my OpenGL ES scene (version 1.1) for which
In order to do object picking in OpenGL, do I really have to render
Platform - iOS. Language - Object c, OpenGL. I have to put 2 UIViews
I'm trying to model an object described in a WRL (VRML) file using OpenGL.
I'm trying to wrap my head around the OpenGL object model on iPhone OS.
I have an object which I want to rotate via keys. The object should
I'm currently using OpenGL on Android to draw set width lines, which work great
I have an OpenGL ES scene which is made up of about 20 objects.
I have one texture that has some portions which are transparent transparent I want
I am completely new to openGl. I have so far studied how to draw

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.