Hello Mohamed,
On 2014-05-03 20:00, mohamed mediouni wrote:
> Thank you for your response
> This my code. But i do all information but the object d'ont nove
have you checked that mWand->getData() actually produces matrices that
are different from the identity matrix?
Your OsApp:draw() function has a stray glPopMatrix in there (after
drawing the model called "mesh"). Also, assuming that mNavMatrix is your
view matrix (since it gets applied to all other objects), it is not
being applied to the selected "femur8" model - is that intentional?
I'm not sure if fixing these things will solve your problem, but at
least they should make analyzing what is happening easier. I also highly
suspect that you'd have been able to spot these things immediately
yourself if your OsApp::draw() function was cleanly formatted [1], the
way it is makes reading and understanding it unnecessary hard IMHO.
> please help me. I'm stuck for 2 months
Hmm, my suggestion would be to do the following:
- Ignore the selection aspect for now, choose one object that you can move
- Find two otherwise unused buttons of your joystick and if one is
pressed apply a translation by a fixed amount along the x-axis to your
moveable object. If the other button is pressed apply the same fixed
amount of translation in the opposite direction along the x-axis.
- If that works make sure your navigation still works and the object
moves in the expected direction even after you change your point of view.
- You could then construct a more interesting transformation to be
applied to the moveable object, for example instead of just translating
along the x-axis, use the wand matrix.
- Finally, bring back the ability to select different objects and have
the movement applied to the selected one, instead of a hard coded choice.
The overall idea behind these steps is to simplify the problem to the
point where it is easier to see what exactly goes wrong if things don't
work right away and then build up from there. Hope it helps,
Cheers,
Carsten
[1] Cleanly formatted code is of course not inherently of better
quality, but at least it does not make it harder to understand what goes
on - or what goes wrong in case of code that you are debugging ;)