Hi,
also ich hab hier so eine Maussteuerung :
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32:
| ... var OMpos : TPoint; yrot : TGLFloat; xrot : TGLFloat; ... procedure Draw.Scene ... ... glRotatef(xrot, 1 ,0, 0); glRotatef(yrot, 0 ,1, 0); ... procedure TGLForm.FormMouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer); var NMPos : TPoint; begin NMPos := Mouse.CursorPos; if OMPos.X < NMPos.X then yrot := yrot+Abs(OMPos.X-NMPos.X)/2; if OMPos.X > NMPos.X then yrot := yrot-Abs(OMPos.X-NMPos.X)/2; if (OMPos.Y>NMPos.Y) and (xrot>-60) then xrot := xrot-Abs(OMPos.Y-NMPos.Y)/4; if (OMPos.Y<NMPos.Y) and (xrot<60) then xrot := xrot+Abs(OMPos.Y-NMPos.Y)/4; OMPos := NMPos; if NMPos.X < Left+10 then SetCursorPos(Left+ClientWidth-11, NMPos.Y); if NMPos.X >= Left+ClientWidth-10 then SetCursorPos(Left+11, NMPos.Y); if NMPos.Y < Top+40 then SetCursorPos(NMPos.X, Top+ClientHeight-11); if NMPos.Y >= Top+ClientHeight-10 then SetCursorPos(NMPos.X, Top+31); NMPos := Mouse.CursorPos; OMPos := NMPos; end; |
Am Anfang funktioniert alles glänzend.
Wenn ich mich aber dann nach vorne bewege dann :
Wenn ich die maus nach "oben" bewege, dann verschiebt sich die ansicht nur um die Y-Achse (verschiebt sich !, dreht sich NICHT!)
... die X-Achse bleibt davon verschont (sie funktioniert immer noch).
Kann mir da jemand weiter helfen ?
MFG
Ice-X2