P5.js: WEBGL : make orbitControl() smoother and more continuous

Created on 5 Jan 2018  路  6Comments  路  Source: processing/p5.js

Nature of issue?

  • [ ] Found a bug
  • [x] Existing feature enhancement
  • [ ] New feature request

Most appropriate sub-area of p5.js?

  • [ ] Color
  • [ ] Core
  • [ ] Data
  • [ ] Events
  • [ ] Image
  • [ ] IO
  • [ ] Math
  • [ ] Typography
  • [ ] Utilities
  • [x] WebGL
  • [ ] Other (specify if possible)

Feature enhancement details:

I think orbitControl() function in WEBGL mode should behave more like (or exactly like..) this sketch. As of right now, when user releases button after click, the camera position goes back to previous position instantly, which doesn't feel like desired behaviour.

GSOC webgl

Most helpful comment

Here is a little fiddle to test. The used library is based on the PeasyCam.

https://jsfiddle.net/t2c8aa1h/

LMB: orbit
MMB: pan
RMB: zoom
dlbclick: reset

All 6 comments

Here is a little fiddle to test. The used library is based on the PeasyCam.

https://jsfiddle.net/t2c8aa1h/

LMB: orbit
MMB: pan
RMB: zoom
dlbclick: reset

i like this suggestion, @mlarghydracept what do you think?

Yeah I think it is probably the more expected behavior.

I will also suggest to have the possibility to invert the control movement.

To better understand what I'm saying, see this demo. In that example, you can move the camera in a more natural way around the room.

Maybe something like orbitControl(INVERT)

I've started working on this with this as a reference (three.js' 'orbitControls' rather than the 'trackballControls' linked above). The main difference between the two according to this stackexchange post is that orbitControl maintains the same cameraUp vector, which helps the user not lose their orientation by accident.

@mcanepa I added x/y sensitivity parameters to orbitControl with #2975, which allows inversion (by entering a negative number). The current (0.6.1) default mode is to have the Y-Axis inverted (dragging mouse down makes camera look up) whereas the new default is non-inverted Y-axis. I just need to figure out why it isn't passing its TravisCI check...

fixed in webgl-gsoc-2018!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

montoyamoraga picture montoyamoraga  路  21Comments

chrisorban picture chrisorban  路  21Comments

shiffman picture shiffman  路  56Comments

lmccart picture lmccart  路  41Comments

workergnome picture workergnome  路  32Comments