Convert mouse position

眉间皱痕 提交于 2019-12-12 01:48:03

问题


I have following code:

int p[2];
m_pRenderWindow->GetInteractor()->GetEventPosition(p);
vtkRenderer* pFoundRenderer = m_pRenderWindow->GetInteractor()->FindPokedRenderer(p[0], p[1]);

if(m_pRenderer2 == pFoundRenderer)
{
    // do something
}

On the m_pRenderWindow I have 4 renderers ... when the m_pRenderWindow is restored, (is not spread on entire screen for instance), p[0] and p[1] are NOT correct ( when the mouse is over a renderer3 the code says that the mouse is over renderer2, or something) ... why ?

I guess that mouse coordinates should be converted into client coordinates ... but how ?

来源:https://stackoverflow.com/questions/28580353/convert-mouse-position

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!