Closed chris2560 closed 5 years ago
@chris-bunting yes, it's rather annoying if you use the demo with a mouse but it makes sense if the mx and my signals are coming from accelerometers measuring head movement such as with a VR display. The relative movement is explained a bit at the top of the program, but probably not very well. The logical thing, if changing to absolute is
CAMERA = pi3d.Camera(absolute=True) # c.f. False
...
mx, my = mymouse.position() # c.f. velocity()
rather than make rot and tilt += This is the way the camera is controlled in most of the first person demos
The world will gradually rotate to one side or the other. This is fixed by setting the camera 'absolute' argument to True, and adding to the previous rot and tilt variables each iteration.
line 116:
CAMERA = pi3d.Camera(absolute=True)
line 154:rot += - mx * 0.2
line 155:tilt += my * 0.2