Difference between revisions of "Tutorial - Picking"
m |
|||
Line 33: | Line 33: | ||
</source> | </source> | ||
}} | }} | ||
+ | To activate that listener we have to add the following code to the '''setupWindow''' method: | ||
+ | |||
+ | {{CppSourceCode|description=Activate mouse button listener|code=<source lang="cpp" line="1"> | ||
+ | glfwSetMouseButtonCallback( mouseButtonListener ); | ||
+ | </source> | ||
+ | }} | ||
+ | |||
+ | |||
For the use of [http://www.horde3d.org/docs/_utils.html#pickNode Horde3DUtils::pickNode] we have to normalize the window coordinates received by ''glfwGetMousePos''. That's why we need to call ''glfwGetWindowSize'' additionally. Another conversion has to be made, since GLFW has it's origin in the upper left corner while Horde3D requires the origin to be in the lower left corner. | For the use of [http://www.horde3d.org/docs/_utils.html#pickNode Horde3DUtils::pickNode] we have to normalize the window coordinates received by ''glfwGetMousePos''. That's why we need to call ''glfwGetWindowSize'' additionally. Another conversion has to be made, since GLFW has it's origin in the upper left corner while Horde3D requires the origin to be in the lower left corner. |
Revision as of 09:47, 15 November 2008
|
|