BIMsurfer-before2019 icon indicating copy to clipboard operation
BIMsurfer-before2019 copied to clipboard

Improvements to bimCameraControl

Open bastienmenis opened this issue 9 years ago • 3 comments

Can we discuss what is the expected behaviour of zoom, orbiting and panning? It appears that the currently implementation is work in progress. Especially I do not understand the following behaviours:

  • Orbiting does not rotate around view.look (always orbits around the centre of the model)
  • Zooming moves both view.eye and view.look so zooming in has the effect of flying through floors

I would prefer the controls to work as follow:

  1. Zoom only change the eye position. Zoom speed is affected by distance between view.eye and view.look
  2. Orbiting only moves the eye around view.look. view.up is always pointing up in the vertical direction and not affected by orbiting. (I don't see any case where we would way to view a building upside down.)
  3. Mouse panning always move in the (x, y) plane. Maybe add a slider or different key shortcuts for moving in the z direction?
  4. Add a visual control button to switch the mouse/touch drag behaviour between orbiting and panning. This is to allow panning on touch devices where there is no keyboard or right click.
  5. Add visual control buttons for zooming (again, for compatibility with touch devices)

Or maybe my usage is too specific and I should write my own camera control class?

bastienmenis avatar Dec 08 '16 16:12 bastienmenis

I'll get some comments in here on how the camera work in a day or two @bastienmenis . Then you can review and decide if you need to roll your own camera control. I'll also see what's involved in making these control pluggable. Just on a sprint at the moment ;)

xeolabs avatar Dec 08 '16 19:12 xeolabs

@bastienmenis you raise good point wrt tot the compatibility on other devices such as tablets and track pads. I think that control buttons for toggling default mouse modes are a bit out of scope for the simple BimSurfer demo, but there should be something in the API to toggle the action associated with the left mouse drag and to set the modes associated with other events and modifier keys. Just a quick proposal:

setDefaultMouseMode( action = (pan | zoom | orbit) )
setEvent( event = [ ((left | middle | right), (click | drag)) | wheel , (ctrl | alt | shift) ], action = (pan | zoom | orbit) )

aothms avatar Dec 09 '16 12:12 aothms

I've created a PR #185 that partially implements @aothms proposal.

bastienmenis avatar Dec 12 '16 11:12 bastienmenis