最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - OrbitControls with damping - Stack Overflow

programmeradmin3浏览0评论

Is there a way, plugin or idea to give the THREE.js OrbitControls the effect of inertia when spinning?

I would like to spin a world-sphere with some damping like this: .js/Polyhedra.html

The original OrbitControls behaviour looks like this:

Is there a way, plugin or idea to give the THREE.js OrbitControls the effect of inertia when spinning?

I would like to spin a world-sphere with some damping like this: http://stemkoski.github.io/Three.js/Polyhedra.html

The original OrbitControls behaviour looks like this: http://threejs.org/examples/#misc_controls_orbit

Share Improve this question edited Nov 23, 2021 at 9:18 Damjan Pavlica 34k10 gold badges75 silver badges78 bronze badges asked Aug 17, 2015 at 21:54 Marcel EnnixMarcel Ennix 1,3661 gold badge12 silver badges17 bronze badges 3
  • Damping is not a feature of OrbitControls in r.71. You can use TrackballControls if you want. – WestLangley Commented Aug 18, 2015 at 0:39
  • 2 The damping feature has now been added in the r.72dev branch of three.js: github.com/mrdoob/three.js/pull/7016. – WestLangley Commented Aug 19, 2015 at 13:25
  • 1 Great! You (and Mr.Doob & all the other people working on three.js) are awesome. Thanks for this information. – Marcel Ennix Commented Aug 19, 2015 at 15:00
Add a comment  | 

1 Answer 1

Reset to default 21

OrbitControls now supports damping / inertia.

controls = new THREE.OrbitControls( camera, renderer.domElement );
controls.enableDamping = true;
controls.dampingFactor = 0.05;

Then in your animation loop add

controls.update(); // required if controls.enableDamping = true, or if controls.autoRotate = true

three.js r.108

发布评论

评论列表(0)

  1. 暂无评论