really sorry to bother you with that.. ..again.. but I don't get it to work
:(
//basic trackball navigation
private:
int lastx;
int lasty;
int lastbutton;
public:
void initNavigator() {
lastx = lasty = lastbutton = 0;
nav = new Navigator();
nav->setCameraTransformation(MAIN_CAMERA_BEACON);
nav->setViewport(getViewport(0));//the glut window viewport
nav->setMode(Navigator::TRACKBALL);
//nav->setRotationAngle(1);
//nav->setMotionFactor (1);
}
void mouse(int button, int state, int x, int y) {
//if(state) nav->buttonPress(button,x,y);
//else nav->buttonRelease(button,x,y);
//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)
I tried a lot of things, the only movement I got was in the mouse()
function, with
void mouse(int button, int state, int x, int y) {
if(state) nav->buttonPress(button,x,y);
else nav->buttonRelease(button,x,y);
...
a mouseclick moves the camera a bit, the wheele does zoom in and out
I have no clue how to continue, please help :)
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)..
thanks for your time and support!
Victor
------------------------------------------------------------------------------
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users