Bonjour � tous, j'utilise actuellement la librairie Three.js pour faire des affichages de fichiers mais le mode de d�placement ne convient (du moins une partie), j'utilise le contr�leur TrackballControls.js mais la partie panCamera n'est pas optimale, je voulais faire en sorte que le centre de l'objet reste toujours le cente de rotation mais il est modifi� � chaque fois qu'on fait un pan. J'esp�re que c'est possible :(
Voici la partie panCamera :
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 this.panCamera = (function(){ var mouseChange = new THREE.Vector2(), objectUp = new THREE.Vector3(), pan = new THREE.Vector3(); return function () { mouseChange.copy( _panEnd ).sub( _panStart ); if ( mouseChange.lengthSq() ) { mouseChange.multiplyScalar( _eye.length() * _this.panSpeed ); pan.copy( _eye ).cross( _this.object.up ).setLength( mouseChange.x ); pan.add( objectUp.copy( _this.object.up ).setLength( mouseChange.y ) ); _this.object.position.add( pan ); _this.target.add( pan ); if ( _this.staticMoving ) { _panStart.copy( _panEnd ); } else { _panStart.add( mouseChange.subVectors( _panEnd, _panStart ).multiplyScalar( _this.dynamicDampingFactor ) ); } } } }());