Hello Victor,
Victor Haefner wrote:
> void mouse(int button, int state, int x, int y) {
> //if(state) nav->buttonPress(button,x,y);
> //else nav->buttonRelease(button,x,y);
I think you should track the pressed/released buttons from here and not
change them in the motion callback.
> //cout << "\nBUTTON " << button << " " << state << " state
> " << nav->getState() << " mode " << nav->getMode();
>
> //if(state) button_pressed |= 1 << button;
> //else button_pressed &= ~(1 << button);
> lastbutton = button;
> lastx = x;
> lasty = y;
>
> return true;
> }
>
> void motion(int x, int y) {
> switch(lastbutton) {
> case 0://rotating
> nav->buttonPress(lastbutton,x,y);
> cout << "\nMOVING " << x << " " << y << " " <<
> lastbutton << " state " << nav->getState() << " mode " << nav->getMode();
> nav->moveTo(x,y);
> nav->updateCameraTransformation();
> cout << "\nMATRIX " << nav->getMatrix();
> break;
> }
>
> lastx = x;
> lasty = y;
> return true;
> }
>
> I used code from the ssm
>
> my problem is in the motion function, moveTo doesn't do anything.. the
> navigator state at this point is 1, the mode 0 (rotation, trackball)
have you looked into moveTo and why it does not do anything, i.e. does
it return early because of a check at the beginning that is not
satisfied? What are the values passed into it, do they make sense and
match your mouse movement?
I don't see much of a difference between your code and what the SSM
uses, so this is a bit puzzling. I assume you already made sure your
callbacks are called, i.e. especially the motion() one gets called all
the time when the mouse moves?
> I just want to use the simple navigation like the standart ssm navigation
>
> ..I can't use the ssm because I have a cluster application, I allready
> made a whole framework for that.. one camera, one client window/viewport
> and one multiwindow for the cluster (with N viewports)..
hm, that setup does not sound overly exotic and there is nothing that
prevents the SSM from being used in a cluster (the cluster examples use
it). Have you tried to just have the SSM manage the client window and
perhaps instead of calling ssm->redraw() call ssm->update() and
clusterWin->render() to get the cluster and client windows to render?
Cheers,
Carsten
------------------------------------------------------------------------------
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users