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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:33:54+00:00 2026-06-01T08:33:54+00:00

I was wondering how I would go about mapping 2D screen coordinates to a

  • 0

I was wondering how I would go about mapping 2D screen coordinates to a 3D world (specifically the xz plane) knowing:

-position of the camera

-equation of the screen plane

-equation of the xz plane

All I want to do is have the land on the xz plane light up when I hover the mouse over it.

Any help is greatly appreciated!

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-06-01T08:33:55+00:00Added an answer on June 1, 2026 at 8:33 am

    If your world is rotated and shifted such that the camera is at x=y=z=0 (world coordinates), the world z coordinate increases away from the viewer (into the screen), and the projection plane is parallel to the screen and is at z=d (world coordinate; d > 0), then you determine screen coordinates from world coordinates this way:

    xs = d * xw / zw
    ys = d * yw / zw

    And that’s pretty intuitive: the farther the object from the viewer/projection plane, the bigger its zw and the smaller xs and ys, closer to the vanishing point of xw=yw=0 and zw=+infinity, which projects onto the center of the projection plane xs=ys=0.

    By rearranging each of the above you get xw and zw back:

    xw = xs * zw / d
    zw = d * yw / ys

    Now, if your object (the land) is a plane at a certain yw, then, well, that yw is known, so you can substitute it and get zw:

    zw = d * yw / ys

    Having found zw, you can now get xw by, again, substitution:

    xw = xs * zw / d = xs * (d * yw / ys) / d = xs * yw / ys

    So, there, given the setup described in the beginning and screen coordinates xs and ys of the mouse pointer (0,0 being the screen/window center), the distance between the camera and the projection plane d, and the land plane’s yw you get the location of the land spot the mouse points at:

    xw = xs * yw / ys
    zw = d * yw / ys

    Of course, these xw and zw are in the rotated and shifted world coordinates and if you want the original absolute coordinates in the “map” of the land, you un-rotate and un-shift them.

    That’s the gist of it.

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

Sidebar

Related Questions

I was just wondering how someone would go about finding all the applications that
I'm wondering how i would go about making the following application: a user signs
I am wondering how I would go about performing a certain function if a
I'm wondering how I would go about the addition and subtraction of numbers in
I was wondering how would go about displaying five images in a row using
Just wondering how you would go about creating the effect as seen in the
I am wondering how I would go about correctly setting up a C++/CLI library
I was just wondering how you would go about giving a application the new
I was wondering what you would think about using jsperf.com Chrome test results as
I was just wondering how would I go about checking to see if, for

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.