我正在为我们的THREE.js应用程序制作正交相机.基本上,该相机将以2D形式向用户呈现场景(用户可以选择在2D和3D相机之间切换).此摄像机将允许平移和缩放到鼠标点.我有平移工作,我有缩放工作,但没有缩放到鼠标点.这是我的代码:
import React from 'react';
import T from 'three';
let panDamper = 0.15;
let OrthoCamera = React.createClass({
getInitialState: function () {
return {
distance: 150,
position: { x: 8 * 12, y: 2 * 12, z: 20 * 12 },
};
},
getThreeCameraObject: function () {
return this.camera;
},
applyPan: function (x, y) { // Apply pan by changing the position of the camera
let newPosition = {
x: this.state.position.x + x * -1 * panDamper,
y: this.state.position.y + y …
Run Code Online (Sandbox Code Playgroud) 我在哪里可以改变three.js中的缩放方向?我想放大鼠标光标的方向,但我没有得到你可以改变缩放目标的位置.