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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:36:47+00:00 2026-06-13T16:36:47+00:00

I found if I define the far plane distance for the perspective matrix to

  • 0

I found if I define the far plane distance for the perspective matrix to be 1,000,000,000 , then all the object inside that range get clipped. Range of 100,000,000 works fine.
Anyone can explain this? I mean , it still doesn’t approximates float number Max range. Or am I wrong on this ? For calculating perspective I use GLM library. No fixed pipeline stiff.

UPDATE: (JAVA)
Perspective matrix calculation:

 public static Mat4 perspective(float fovy, float aspect, float zNear, float zFar) {
    float range = (float) (Math.tan(Math.toRadians(fovy / 2.0f)) * zNear);
    float left = -range * aspect;
    float right = range * aspect;
    float bottom = -range;
    float top = range;

    Mat4 res = new Mat4(0.0f);

    res.matrix[0] = (2.0f * zNear) / (right - left);
    res.matrix[5] = (2.0f * zNear) / (top - bottom);
    res.matrix[10] = -(zFar + zNear) / (zFar - zNear);
    res.matrix[11] = -1.0f;
    res.matrix[14] = -(2.0f * zFar * zNear) / (zFar - zNear);

    return res;
  }
  • 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-13T16:36:48+00:00Added an answer on June 13, 2026 at 4:36 pm

    What you are seeing is a rounding problem due to the very finite precision of floating point numbers.

    Although floating point numbers have huge (for most practical applications “infinite”) range, they have a limited precision which is well below that of an integer of the same size. A single precision (32-bit) float can represent little over 7 decimal digits. You can have extremely small or large (smaller and larger than you can imagine) numbers, but they still only have 7.22 valid decimal digits.

    The only numbers representable as a single precision float between 999,999,900 and 1,000,000,100 are: 999999872, 999999936, 1000000000, and 1000000064. You can easily verify this by counting an integer variable in a for loop, casting to a float variable, and printing it.

    Which means that for example 999,999,950 and 999,999,951 and 999,999,999 are exactly the same number, so 999,999,950 may get clipped although it is “obviously” in front of the clipping plane.

    EDIT:

    Little demo program with output:

    #include <stdio.h>
    
    int main()
    {
        float f = 0.0f;
        for(int i = 999999900; i < 1000000100; ++i)
        {
            f = i;
            printf("%d\t%f\n", i, f);
        }
        return 0;
    }
    
    999999900       999999872.000000
    999999901       999999872.000000
    999999902       999999872.000000
    999999903       999999872.000000
    999999904       999999872.000000
    999999905       999999936.000000
    999999906       999999936.000000
    999999907       999999936.000000
    ...
    [some lines omitted]
    ...
    999999967       999999936.000000
    999999968       1000000000.000000
    999999969       1000000000.000000
    999999970       1000000000.000000
    999999971       1000000000.000000
    999999972       1000000000.000000
    ...
    [some lines omitted]
    ...
    1000000028      1000000000.000000
    1000000029      1000000000.000000
    1000000030      1000000000.000000
    1000000031      1000000000.000000
    1000000032      1000000000.000000
    1000000033      1000000064.000000
    1000000034      1000000064.000000
    1000000035      1000000064.000000
    1000000036      1000000064.000000
    1000000037      1000000064.000000
    1000000038      1000000064.000000
    1000000039      1000000064.000000
    1000000040      1000000064.000000
    1000000041      1000000064.000000
    1000000042      1000000064.000000
    1000000043      1000000064.000000
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In standard library, I found that namespace std is declared as a macro. #define
All the solutions I have found so far for changing the color of the
How to define XAML to rotate a rectangle infinitely? So far I found a
I've done some Google searches and so far I haven't found anything that answers
I am reading some materials on Java serialization and found that, for self defined
Why I get this error? Page not found (404) Using the URLconf defined in
found this little code snippet that seems to do what i want, but im
I found this wonderfull tooltip called qTip2. Loving it so far but has gotten
Is it possible to define a current user? I found a stored procedure 'sp_mgGetConnectedUsers'.
I've not found anything that addresses my specific name space question as yet. I

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.