Solved

OpenGL and MFC - Lclick coordinate

Posted on 1997-09-21
4
316 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

932 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now