Linux: miniB3D works, but mouse is "jumpy"
BlitzMax Forums/MiniB3D Module/Linux: miniB3D works, but mouse is "jumpy"
| ||
| Hello everybody, I'm kind of a newbie to this stuff (3D coding) so I tried out miniB3D on my Ubuntu Linux today. With the appropriate fixes mentioned in the miniB3D wiki I was able to get everything to compile and the 3D demos work out fine. Except one thing: whenever I move the mouse, instead of moving the mouse pointer ist getting centered again, resulting in a "shaking" mouse pointer, causing the whole scenery to "shake". This behaviour shows up only on Linux, on Mac OS X everything works just fine. Kind regards, lodger |
| ||
| YEah i just found this out too, Here is my 'fix', workaround or whatever you want to call it. I have used the built in max cursor position report instead of the b3d one. It seems to be pretty smooth.
Type T_MouseLook
Field resetX%
Field resetY%
Field speedX% 'not needed externally but may be useful for other things
Field speedY%
Field pitch:float 'smoother inverse value for rotation
Field yaw:float
Method Init(rX% , rY%)
resetX = rx
resetY = ry
End Method
Method Pollmouse()
speedX = resetX - MouseX()
speedY = resetY - MouseY()
yaw :- Float(-speedX) / 15
pitch :+ Float(-speedY) / 15
MoveMouse(resetX,resetY)
End Method
Method flush()
speedX = 0
speedY = 0
MoveMouse(resetX,resetY)
End Method
End Type
'Initialise mouselook
local mlook:T_MouseLook=New t_mouselook
mlook.init(512,350) ' or width/height*.5 etc
mlook.flush() 'kills any initial movements
While Not KeyDown(KEY_ESCAPE)
;Poll mouse and adjust rotation values.
mlook.pollmouse()
RotateEntity cam, mlook.pitch, mlook.yaw, 0
(......rest of main loop)
|