[英]Get screen coordinates and size of OpenGL 3D Object after transformation
I have a couple of 3D objects in OpenGL in a processing sketch and I need to find out if the mouse is hovering over those objects. 在处理草图中,我在OpenGL中有几个3D对象,我需要确定鼠标是否悬停在这些对象上。 Since there is constant transformation I can't compare the original coordinates and size to the mouse position.
由于存在常量转换,因此无法将原始坐标和大小与鼠标位置进行比较。 I already found the screenX() and screenY() methods which return the translated screen coordinates after transformation and translation but I would still need to get the displayed size after rotation.
我已经找到了screenX()和screenY()方法,它们在转换和转换后返回转换后的屏幕坐标,但是旋转后我仍然需要获取显示的大小。
Determining which object the mouse is over is called picking and there are 2 main approaches: 确定鼠标悬停在哪个对象上称为拾取,主要有两种方法:
From reading your description option 1 would probably be simpler and do what you need. 阅读您的描述选项1可能会更简单,并且可以完成您需要的操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.