Click here to Skip to main content
15,921,884 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm trying to draw 4 3D cubes in windows application. When someone click on the first cube then MessageBox shows the first cube is clicked and same for other 3.
Can somebody help me how to do this please...
Updated 7-Apr-12 7:28am
OriginalGriff 7-Apr-12 11:02am    
Which part is giving you difficulty?
Kul_7 7-Apr-12 11:07am    
Actually I don't know to how this will be done can u please explain me from startting..
Kuldeep B 9-Apr-12 13:36pm    
Thanks OriginalGriff...
I'm facing hit test problem..I posted my code under Discussion Tab..with Subkect wpf

Please solve this for me...

Ok. I can't/won't give you the code. But here is a way you could get this

1. Set up you App to draw using OpenGL
2. Draw the cubes and maintain the cubes faces (drawn as triangle_strips) in a list
3. Now you should handle mouse click events to know which triangle_strip is clicked (by using some hit-list feedback mechanism)
4. Once you know the cube having the clicked triangle_strip, you can pop-up message accordingly.
Share this answer
Shahin Khorshidnia 7-Apr-12 13:27pm    
My +5
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900