Solved

OpenGL and MFC - Lclick coordinate

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
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…

760 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

19 Experts available now in Live!

Get 1:1 Help Now