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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:49:04+00:00 2026-05-17T23:49:04+00:00

ok when i used to draw stuff using gdi+ i used to know the

  • 0

ok when i used to draw stuff using gdi+ i used to know the coordinates for objects but now when im using meshes in directx 9 i have no idea how to get the coordinates for the object so i can find if the mouse over an object. any idea how to find the coordinates ?

  • 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-17T23:49:05+00:00Added an answer on May 17, 2026 at 11:49 pm

    You need to cast the mouse position into the world and convert it to world-space coordinates, which then are tested against the various objects. You may be able to find a library to do this for you, I know OpenGL supports picking and most wrappers offer enhanced functions for that, but the principle is:

    Find the mouse coordinates in the window. Using those coordinates, cast a ray (whether you actually use a ray in the system or simply do similar math isn’t a big deal here) into the world. You’ll use the current view matrix (“camera” angle and position) to calculate the direction and origin of the ray. Using that ray, test against your objects, their bounding boxes or geometry (whichever you choose) to find the object. Using the intersection coordinates, find the object that is at that location.

    You can also use the depth buffer for this very easily, if your scene is relatively static. Simply render with a depth texture set as the Z buffer, then use the depth, mouse position and view matrix to find the point of intersection.

    It may be possible to do this in reverse, that is, map each object to the appropriate screen coordinates, but you will likely run into issues with depth sorting and overlapping areas. Also, it can be unnecessarily slow mapping every object to window areas each frame.

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

Sidebar

Related Questions

I used to charts using core-plot framework, my requirement is draw vertical line as
I have a graph where user can draw the graph using touch gesture, i
I want to draw a HBITMAP onto HDC, I used StretchDIBits. It works fine.
I used jQuery to set hover callbacks for elements on my page. I'm now
I'm currently using a VBO for the texture coordinates, normals and the vertices of
I'm somewhat new to OpenGL. I've used it for extremely simple stuff like rendering
I would like to draw a random number from the interval 1,49 but I
We used the undocumented xp_fileexist stored procedure for years in SQL Server 2000 and
I used the LINQ to SQL designer in Visual Studio to create an object
Never used a cache like this before. The problem is that I want to

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.