一、常用相机
(1)万能相机
代码示例:
let camera=new BABYLON.FreeCamera('camera',new BABYLON.Vector3(0,10,0),scene)
//camera.beta=Math.PI/5
//鼠标滚轮控制
camera.inputs.addMouseWheel()
//沿x轴滚动
camera.inputs.attached["mousewheel"].wheelYMoveRelative = BABYLON.Coordinate.X;
//沿y轴滚动
camera.inputs.attached["mousewheel"].wheelYMoveRelative = BABYLON.Coordinate.Y;
//沿z轴滚动
camera.inputs.attached["mousewheel"].wheelYMoveRelative = BABYLON.Coordinate.Z;
//反转鼠标滚轮
camera.inputs.attached["mousewheel"].wheelPrecisionY = -1;
//相机可控,默认不可控
camera.attachControl(true)
(2)弧形旋转相机
var camera = new BABYLON.ArcRotateCamera("Camera", 0,0,10,
new BABYLON.Vector3(0, 0, 0), scene);
(3)跟随相机
相机跟随目标&