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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:11:10+00:00 2026-05-20T15:11:10+00:00

I am learning OpenGL and having a problem with gluPerspective. Here is the code

  • 0

I am learning OpenGL and having a problem with gluPerspective. Here is the code I use in Init()

// Calculate The Aspect Ratio Of The Window
// The parameters are:
// (view angle, aspect ration of the width to the height, 
//  The closest distance to the camera before it clips, 
// FOV, Ratio,  The farthest distance before it stops drawing)
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height, 0.5f, 3000.0f);

My scene works right.. but as soon as I go a little bit away from my objects they dissapear (As the red balls in image). : Frustrum example
Web where I took graph from

I understand that red balls are outside of view and won’t be shown. So what I want is to increase the distance where it stops drawing. I tried increasing 3000.0f but is not working!.

    gluPerspective(45.0f,(GLfloat)width/(GLfloat)height, 0.5f, 3000000.0f);

So my question is : How can I increase distance where openGL stops drawing objects?

Some pics about the problem:
Pic1
Pic2

  • 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-20T15:11:11+00:00Added an answer on May 20, 2026 at 3:11 pm

    I figured out what was happening so I answer this myself to help other people in the future:

    Changing zfar works ok. The problem I had was (not included in the question for simplification) was my skybox. Skybox was small and was hiding the objects with the sky. In pic2 is easy to see!

    So if you have a similar problem just double check your skybox. If it were a zfar problem everthing should
    be black instead of having a sky texture!

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

Sidebar

Related Questions

I am learning to use shaders in OpenGL ES. As an example: Here's my
Total noob here learning openGL and I don't have any code to post because
I'm having a problem implementing a Feed-Forward MultiLayer Perceptron, with back-prop learning in OpenCL
The problem is that, shaders (pretty simple ones, as I'm learning OpenGL) fail to
I'm interested in learning to use OpenGL and I had the idea of writing
I have enjoyed learning to use OpenGL under the context of games programming, and
I'm learning OpenGL ES. When I'm using texture for triangle, I meet error. Here
I am learning OpenGL these days, and I tried to compile the example code
I'm learning about how to use JOGL and OpenGL to render texture-mapped quads. I
I am learning OpenGL NeHe Production.When I read lesson22 Bump-Mapping、Multi-texture,I got a problem. When

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.