Egret3D 5.3.0 3DCamera相机的使用

转自:http://www.bugcreater.com/697.html

 

//摄像机
let cameraObject = new paper.GameObject();
cameraObject.tag = “MainCamera”;
let camera = cameraObject.addComponent(egret3d.Camera);
camera.cullingMask = egret3d.CullingMask.Everything;
// camera.near = 0.1; 相机到近裁剪面距离
// camera.far = 100; 相机到远裁剪面距离
camera.order = 0;
camera.backgroundColor = new egret3d.Color(0.0, 0.0, 0.0, 1.0);
// camera.clearOption_Color = false; // 渲染前不清除颜色缓冲,保证上一个相机的绘制结果                            
不会被清除
// camera.clearOption_Depth = true; // 清除深度缓冲,避免深度缓冲冲突
cameraObject.transform.setLocalPosition(0, 6, 20);
// cameraObject.transform.setRotation(new egret3d.Quaternion(0,0,0));
cameraObject.transform.lookAt(new egret3d.Vector3(0,4,0));

 

没有更多推荐了,返回首页