Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VRDolly class? #9032

Closed
4 of 11 tasks
pindiespace opened this issue May 29, 2016 · 0 comments
Closed
4 of 11 tasks

VRDolly class? #9032

pindiespace opened this issue May 29, 2016 · 0 comments

Comments

@pindiespace
Copy link

Description of the problem

Dolly movements are implemented inconsistently using VRControls + camera-type controls, and this shows up if you try to use an instance of one camera to "dolly" a primary camera in a WebVR scene.

//create camera
camera = new THREE.PerspectiveCamera(70, domWidth / domHeight, 0.1, 10000);
controls = new THREE.VRControls(camera);

// dolly as another camera
 var dolly = new THREE.PerspectiveCamera();
controls = new THREE.OrbitControls(dolly);

Dollys are distinct entities from cameras. They have some, but not all the features of their camera passengers. it is useful to give regular THREE objects dolly features in a VR world (e.g. a boat moving the VR viewer downriver).

// dolly as an object
controls = new THREE.FlyControls(dolly);
dolly = new THREE.Group();
scene.add(dolly); //currently would have to manually move non-camera object in a camera-like way, already done in some WebVR demos like RollerCoaster

I've experimented with dollying using OrbitControls and FlyControls, and regular objects with WebVR to make a dolly. Behavior is inconsistent across browsers and across versions of THREE, the version of webvr polyfill, and the controls. Often, VRControls ends up fighting with the added cameras.

IMHO, it makes sense to build a VRDolly class that normalizes behavior, and provides a standard set of dollylike moves in a VR scene. Dollys would inherit from standard THREE objects or groups.

//VRDolly is a standard object that can be made to move in cameralike ways
dollycontrols = new THREE.VRDolly(); 

One advantage of this approach would be formalizing WebVR dolly features, making resulting code more straighforward.

Three.js version
  • Dev
  • r77
  • ...
Browser
  • All of them
  • [X ] Chrome
  • [X ] Firefox
  • Internet Explorer
  • Edge
  • Mobile
OS
  • [X ] All of them
  • Windows
  • Linux
  • Android
  • IOS
Hardware Requirements (graphics card, VR Device, ...)

Any devices capable of presenting a WebVR scene in regular and stereo rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants