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 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 have enjoyed learning to use OpenGL under the context of games programming, and
I'm learning to use normal maps (per pixel lighting?) in 2D graphics with OpenGL.
So I am learning OpenGL with as the main resource having the Red book.
I'm learning OpenGL and having a hard time finding a clear definition of the
Having only recently started learning the 'new' OpenGL (programmable as opposed to fixed-function, I
I've been learning OpenGL, and I decided to code a function to draw a
I'm learning some OpenGL game programing, and I'm stuck in how to implement so
I recently started working with OpenGL ES for the iPhone, and I am having
I'm interested in learning OpenGL and my favorite language at the time is Java.
I am learning OpenGL and just started getting into lighting. I enable lighting and

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.