Skip to content

Commit

Permalink
Feature : added new PlanarControls
Browse files Browse the repository at this point in the history
PlanarControls offers ergonomic camera controls for the planar mode : drag, pan, orbit,
zoom and animated expression to smoothly move and orient the camera.

Modified planar example to use these controls
Update contributors

Modifications following peppsac review :
-all external variables are now within the class, this allows to
instanciate more than one controller.
-clamp01 function removed, using THREE clamp instead.
-various style modifications (separator removed, const array format...)
  • Loading branch information
EmmanuelSchmuck committed Aug 25, 2017
1 parent 14dd6fb commit 91eafa1
Show file tree
Hide file tree
Showing 5 changed files with 760 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ The following people have contributed to iTowns 2.

* [AtolCD](http://www.atolcd.com)
* [Thomas Broyer](https://github.com/tbroyer)

* [LIRIS](https://liris.cnrs.fr/)
* [Nicolas Saul](https://github.com/NikoSaul)
* [Emmanuel Schmück](https://github.com/EmmanuelSchmuck/)
* [Marie Lamure](https://github.com/mlamure)

The following organizations supported iTowns2 :
* IGN ( http://www.ign.fr )
Expand Down
11 changes: 7 additions & 4 deletions examples/planar.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@
<div id="help">
<p>Key bindings</p>
<ul>
<li>↑ ↓ : forward / backward</li>
<li>← → : strafe left / right</li>
<li>⇞ (PageUp), ⇟ (PageDown) : move up / down</li>
<li>mouse Clic + drag : camera rotation</li>
<li>Left-Click: camera translation (drag)</li>
<li>Right-Click: camera translation (pan)</li>
<li>Ctrl + Left-Click: camera rotation (orbit)</li>
<li>Spacebar / Wheel-Click: smart zoom</li>
<li>Mouse Wheel: zoom in/out</li>
<li>S: move camera to start position</li>
<li>T: orient camera to a top view</li>
</ul>
</div>
<div id="viewerDiv"></div>
Expand Down
2 changes: 1 addition & 1 deletion examples/planar.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ view.camera.camera3D.lookAt(extent.center().xyz());

// instanciate controls
// eslint-disable-next-line no-new
new itowns.FirstPersonControls(view, { focusOnClick: true, moveSpeed: 1000 });
new itowns.PlanarControls(view, {});

// Request redraw
view.notifyChange(true);
Expand Down
1 change: 1 addition & 0 deletions src/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export { default as PointsMaterial } from './Renderer/PointsMaterial';
export { default as PointCloudProcessing } from './Process/PointCloudProcessing';
export { default as FlyControls } from './Renderer/ThreeExtended/FlyControls';
export { default as FirstPersonControls } from './Renderer/ThreeExtended/FirstPersonControls';
export { default as PlanarControls } from './Renderer/ThreeExtended/PlanarControls';
export { default as GeoJSON2Three } from './Renderer/ThreeExtended/GeoJSON2Three';
export { CONTROL_EVENTS } from './Renderer/ThreeExtended/GlobeControls';
export { default as DEMUtils } from './utils/DEMUtils';
Loading

0 comments on commit 91eafa1

Please sign in to comment.