简体   繁体   中英

how to make a 3D opengl drawn object respond to clicks

I have a cube in openTK (openGL C#) and I want it to respond to mouse clicks. Is there any inbuilt function to do this? I would be very glad to have some help on the subject as I cannot find the right keywords to find it in google. All I need is a function that would return the area it currently occupies on the 2D screen. Then I could find if the mouse has clicked on this area. Any help is appreciated.

OpenGL does not have a built-in function for object picking. The Picking example shows one way to implement this in OpenTK. Depending on your project, there may be simpler or faster ways to do this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM