zoukankan      html  css  js  c++  java
  • Laya3D-多照摄像机

    Laya3D-多照摄像机

     /* 多照相机 */
    export class MultipleCamera extends Laya.Scene3D{
            private camera1:Laya.Camera;
            private camera2:Laya.Camera;
            constructor() {
                super();
                this.init();
            }
            private init():void{
                //摄像机1
                this.camera1 = this.addChild(new Laya.Camera( 0, 0.1, 100)) as Laya.Camera;
                this.camera1.clearFlag = Laya.CameraClearFlags.SolidColor;
                this.camera1.transform.translate(new Laya.Vector3(0, 0, 1.5));
                this.camera1.normalizedViewport = new Laya.Viewport(0, 0, 0.5, 1.0);
                //摄像机2
                this.camera2 = this.addChild(new Laya.Camera( 0, 0.1, 100)) as Laya.Camera;
                this.camera2.transform.translate(new Laya.Vector3(0, 0, 1.5));
                this.camera2.normalizedViewport = new Laya.Viewport(0.5, 0.1, 0.5, 0.5);
                this.camera2.clearFlag = Laya.CameraClearFlags.Sky;
                Laya.Material.load("res/threeDimen/skyBox/skyBox2/skyBox2.lmat", Laya.Handler.create(this, function(mat:Laya.SkyBoxMaterial):void {
                    let skyRenderer:Laya.SkyRenderer = this.camera2.skyRenderer;
                    skyRenderer.mesh = Laya.SkyBox.instance;
                    skyRenderer.material = mat;
                }));
                let directionLight:Laya.DirectionLight = this.addChild(new Laya.DirectionLight()) as Laya.DirectionLight;
                Laya.Sprite3D.load("res/threeDimen/skinModel/LayaMonkey/LayaMonkey.lh", Laya.Handler.create(this, function(sp:Laya.Sprite3D):void {
                    let layaMonkey:Laya.Sprite3D = this.addChild(sp) as Laya.Sprite3D;
                }));
            }
        }
    

      

  • 相关阅读:
    Golang---反射(reflect)
    golang--交替打印一个数组中的元素
    Golang---基本类型(interface)
    利用random5 生成 random7
    Golang---基本类型(map)
    Golang---基本类型(slice)
    Golang---基本类型(string)
    二维码扫码登录原理
    Golang---内存逃逸
    关于我
  • 原文地址:https://www.cnblogs.com/kootimloe/p/14651014.html
Copyright © 2011-2022 走看看