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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:46:41+00:00 2026-05-20T17:46:41+00:00

In OpenGL ES, how do I specify what the maximum visibility distance is? I’ve

  • 0

In OpenGL ES, how do I specify what the maximum visibility distance is? I’ve found that when I do:

gl.glTranslatef(0,0,-10f);

everything I draw is invisible because it’s too far away from the camera. How do I specify that it should draw things farther away?

  • 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-20T17:46:42+00:00Added an answer on May 20, 2026 at 5:46 pm

    The solution to your problem HappyEngineer is simply tinkering with the static GLU.gluPerspective() method. Here is the code I am using for rendering a simple cube (just the view setup code) in my project (I’m also learning):

    public void onSurfaceChanged(GL10 gl, int width, int height)
        {
            //Reset The Projection Matrix
            Log.v("Home", String.valueOf(height));
            gl.glViewport(0, 0, width, height);     //Reset The Current Viewport
            gl.glMatrixMode(GL10.GL_PROJECTION);    //Select The Projection Matrix
            gl.glLoadIdentity();    
            //Calculate The Aspect Ratio Of The Window
            GLU.gluPerspective(gl, 45.0f, (float)width / (float)height, 0.1f, 1000.0f);
    
            gl.glMatrixMode(GL10.GL_MODELVIEW);     //Select The Modelview Matrix
            gl.glLoadIdentity(); 
        }
    

    So even if you’re new to GL the names of these functions + the parameters should be fairly obvious if you have any background in 3D. For the function of interest, gluPerspective, you’re passing a reference to your GL instance, the angle of the FOV or field of view, aspect ratio and then the far plane or maximum view distance. So that you understand the context in which this code is used, I’m using it inside of a GLWallpaperService (GL LiveWallpaper) within the onSurfaceChanged event. For more nfo on that see the following:

    http://mindtherobot.com/blog/376/android-ui-making-a-live-wallpaper-fire-simulation/

    http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live-wallpapers

    Also some nice tutorials for working with glES on droid:

    http://blog.jayway.com/2009/12/03/opengl-es-tutorial-for-android-part-i/

    http://insanitydesign.com/wp/projects/nehe-android-ports/

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

Sidebar

Related Questions

I have an OpenGL ES game that I am hacking together. One part of
I am rendering an OpenGL scene that include some bitmap text. It is my
I have a series of OpenGL-ES calls that properly render a triangle and texture
In my OpenGL app, it won't let me draw a line greater then ten
I'm using OpenGL ES on Android to draw some shapes, so I have some
assuming that some opengl-veterans might facepalm now :-) I am working on a tilebased
I'm writting a opengl C program, and I know that most graphical jobs are
OpenGL. Let's say I've drawn one image and then the second one using XOR.
In OpenGL I'm trying to rotate a camera around a point, with camera being
In my simple OpenGL program I get the following error about exit redefinition: 1>c:\program

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.