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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:55:54+00:00 2026-05-19T00:55:54+00:00

I have a 2.5d viewport wherein I am trying to express a visualization of

  • 0

I have a 2.5d viewport wherein I am trying to express a visualization of the depth of a box with 45 degree 2D lines inwards as if it had no front and you were staring inside from a central point, like this:

-------------
| \_______/ |
| |       | |
| |_______| |
| /       \ |
-------------

I want to draw the metaphor with real 3D geometry, in that the distance of the inner rect from the outer rect is correct, given a camera distance (say fixed at 2 feet for an average eye distance from the user’s monitor)

How can I derive the “common inner side width” from: the centered camera distance, the width and height of the box, and the depth I’m trying to represent?

Thanks!

  • 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-19T00:55:55+00:00Added an answer on May 19, 2026 at 12:55 am

    What’s you’re looking for is a perspective projection. In addition to the position of the camera and dimensions of the box, you also need a “screen” somewhere between the camera and the box onto which the box will be projected. The distance from the camera to this screen will scale the size of the projected box.

    Let’s say the camera is at the origin and z units away from the box, the screen is one unit away from the camera, and the box was depth d, width 2w, and height 2h.

    In 3D ambient space, the top-left corner of the box is at position (-w, h, z). The ray between the camera and this point intersects the projection screen at (-w/z, h/z, 1).

    The top-left corner of the floor of the box is at position (-w, h, z+d) which is projected to (-w/(z+d), h/(z+d), 1).

    Similarly, you can find the positions of the other projected points. Therefore the width of the outer box on the screen is 2w/z, the width of the inner box 2w/(z+d), and analogously for the heights. The inner box is thus just a uniformly scaled version of the outer box, with the inner box dimensions z/(z+d) times the outer box ones.

    Note that the diagonals connecting the two boxes are not oriented at 45 degrees unless the box happens to be square.

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

Sidebar

Related Questions

I have a ExtJS panel inside a viewport center region. I want to hide
I'm trying to have a minimap display with a draggable viewport below a chart.
I am trying to implement responsive web design and I have set the viewport
I have this simple tabBar inside a TabPanel: MyApp.views.Viewport = Ext.extend(Ext.TabPanel, { fullscreen: true,
I'm working on an iOS web app and I have the viewport set to
I have an ExtJS Viewport with a container that has the border layout and
I have a footer that is fixed to the bottom of the viewport. I
I'm working on a website and have been using absolute positioning, since the viewport
I have a viewport setup with orthographic projection. If I ask OpenGL to draw
I have a Ext.Viewport in my page... In North region , I have a

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.