Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

OpenGL and MFC - Lclick coordinate

Posted on 1997-09-21
4
Medium Priority
?
330 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

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.  …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

604 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