我想用鼠標旋轉相機。移動它不是問題,但我需要將它保存在一個地方。我試過glutWarpPointer(),但它會顯着減慢程序速度。我正在嘗試爲某個東西寫一個引擎,但不想使用和添加。在GLUT中更改鼠標位置?
int diff = x - oldx;
oldx = x; rx += diff;
if (rx > 360)
rx = 0;
if (rx < 0)
rx = 360;
NSLog(@"%f",rx);
back = YES;
glutWarpPointer(0, 0);
glutPostRedisplay();
請張貼一些代碼 – Saphrosit
int diff = x - oldx; oldx = x; rx + = diff; if(rx> 360) rx = 0; if(rx <0) rx = 360; NSLog(@「%f」,rx); back = YES; glutWarpPointer(0,0); glutPostRedisplay(); – BlueSpud