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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:17:17+00:00 2026-05-14T03:17:17+00:00

How can I scale a random 3d model to fit in an opengl viewport?

  • 0

How can I scale a random 3d model to fit in an opengl viewport? I am able to center the model in the middle of the view port. How do I scale it to fit it in the viewport. The model could be an airplane, a cone, an 3d object or any other random model.

Appreciate any help.

  • 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-14T03:17:17+00:00Added an answer on May 14, 2026 at 3:17 am

    You’ll need the following information:

    • r: the radius of the object’s bounding sphere
    • z: the distance from the object to the camera
    • fovy: the vertical field of view (let’s say in degrees) of the camera, as you might have passed it to gluPerspective

    Make a little sketch of the situation, find the right triangle in there, and deduce the maximum radius of a sphere that would fit exactly. Given the above parameters, you should find r_max = z * sin(fovy*M_PI/180 / 2).

    From that, the scale factor is r_max / r.

    All this assumes that the viewport is wider than it is high; if it’s not, you should derive fovx first, and use that instead of fovy.

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

Sidebar

Related Questions

So I can make a div to scale nicely from it's center pivot: http://jsfiddle.net/uTDay/
I'd like to begin thinking about how I can scale up my algorithms that
I am trying to make Custom RelativeLayout which can scale and scroll. Right now
I have been learning the mapreduce algorithm and how it can potentially scale to
The documentation states: Precision can range from 1 to 38. Scale can range from
I can't seem to find documentation regarding the ability to scale axes in a
I have used ImageView's before and understand the different scale types that can be
The program below can generate random data according to some specs (example here is
What library / method can I use for deep generation of random objects for
UIImage always become indistinct when it was scaled.What can i do if make it

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.