Solved

OpenGL and MFC - Lclick coordinate

Posted on 1997-09-21
4
325 Views
Last Modified: 2013-12-03
I have a 2-D grid on a window. When the user left clicks on
the space of the grid, I need to get the coordinate that was clicked in the OpenGL projection, not the pixel coordinates
of the window passed in Cpoint of the OnLButtonDown(UINT nFlags, CPoint point).

I need help finding those corrindates so that the user can create an object where he just clicked.
[Using Visual C++ 5.0]
0
Comment
Question by:vinny5
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 

Author Comment

by:vinny5
ID: 1406969
Edited text of question
0
 

Author Comment

by:vinny5
ID: 1406970
Edited text of question
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 500 total points
ID: 1406971
When displaying the grid, don't you keep track of the origin of the grid and the projection matrix? If so, then you can apply the projection matrix to the point after adjusting for the origin of the grid. This will give you the translated point.


0
 

Author Comment

by:vinny5
ID: 1406972
Thanks, but I still dont exactly know how to apply the projection matrix to the point.  But I see what your saying, I have the superbible and I havent seen an example like this. If you havent noticed im a begginer of OpenGL, and MFC.

0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question