Skip to content

三维坐标系

Threejs中三维坐标系如图所示

image-20241011112110064

原点在canvas画布的中央,x轴向右,y轴向上,z轴对着屏幕垂直指向自己

辅助观察坐标系

THREE.AxesHelper()对象可以帮助我们建立一个三维坐标系

three.js坐标轴颜色红R、绿G、蓝B分别对应坐标系的xyz轴,对于three.js的3D坐标系默认y轴朝上

js
const axesHelper = new THREE.AxesHelper(20)
scene.add(axesHelper)

THREE.AxesHelper()可传入一个长度作为参数,效果如下

image-20241011112548972

MIT Licensed