如何围绕轴旋转 Three.js Vector3?

How to rotate a Three.js Vector3 around an axis?(如何围绕轴旋转 Three.js Vector3?)

本文介绍了如何围绕轴旋转 Three.js Vector3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将 Three.js Vector3 绕轴旋转一定角度?

How to rotate a Three.js Vector3 by a certain angle around an axis?

推荐答案

var vector = new THREE.Vector3( 1, 0, 0 );

var axis = new THREE.Vector3( 0, 1, 0 );
var angle = Math.PI / 2;

vector.applyAxisAngle( axis, angle );

这篇关于如何围绕轴旋转 Three.js Vector3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何围绕轴旋转 Three.js Vector3?