Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/400.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在三个JS中创建转换管道_Javascript_Three.js_Transformation - Fatal编程技术网

Javascript 在三个JS中创建转换管道

Javascript 在三个JS中创建转换管道,javascript,three.js,transformation,Javascript,Three.js,Transformation,我正在努力解释我的问题,所以请容忍我 是否有一种推荐的方法可以对每个帧的原始形状的对象重新应用相同的变换,以便在变换更改原始对象时可以轻松看到差异。在下面的伪代码中,有一个原始对象。在每个帧中,我们将当前变换应用于原始对象,以便可以看到差异 UI Slider: Scale UI Slider: Rotate UI Slider: Position For each frame { Original Object -> ApplyCurrentScale -> ApplyCur

我正在努力解释我的问题,所以请容忍我

是否有一种推荐的方法可以对每个帧的原始形状的对象重新应用相同的变换,以便在变换更改原始对象时可以轻松看到差异。在下面的伪代码中,有一个原始对象。在每个帧中,我们将当前变换应用于原始对象,以便可以看到差异

UI Slider: Scale
UI Slider: Rotate
UI Slider: Position

For each frame {
  Original Object -> ApplyCurrentScale -> ApplyCurrentRotate -> ApplyCurrentPosition    
  Render New Object     
}

这样,当您实时更改变换时,您可以看到效果。我希望这是有意义的。

从滑块中提取参数后,以下是要遵循的模式:

object.scale.set( s, s, s );

object.setRotationFromAxisAngle( axis, angle ); // r.59

object.position.set( x, y, z );

renderer.render( scene, camera );
设置旋转的另一种方法是:

object.rotation.y = angle;
3.js r.59