Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SceneHandler::ComputeHits always return zero when it is combined with OpenGlRenderState::Follow #387

Open
lefutonku-github opened this issue Jul 13, 2018 · 0 comments

Comments

@lefutonku-github
Copy link

lefutonku-github commented Jul 13, 2018

Recently I am trying to use the scenehandler to facilitate an selectable pangolin window, like the following picture. the original cubes in the window are green, i want them to recognize the mouse 'click' on them and then change to red color.

image

I use the sceneHandler which seems designed for this scenarios, it works fine in the beginning, but after i use OpenGlRenderState::Follow(mat) in the example,  the cube immediately become un-recognizable, which is caused by the  always zero value returned in SceneHandler::ComputeHits.

I did some debug in GDB and in my understanding, it's seems caused by the function here

image

Once the OpenGlRenderState is set to follow an un-indentical matrix, the 'T_cw' and 'modelview' field will change accordingly, then here comes the difference between GL_RENDER mode and GL_SELECT mode, so it's unable to hit anything. see:
  1. the GL_RENDER mode, the model view matrix is multiplied by T_CW
    image

  2. the GL_SELECT mode, not multiplied with T_CW
    image

    i just raise this very messy pull request for understanding the problem and propose the possible fix. a more cleaner pull request can be raised once it's confirmed
    Test scenehandler with follow #386

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant