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;
                }));
            }
        }
    

      

  • 相关阅读:
    利用Apache AXIS 1 发布WebService
    WebService(基于AXIS的WebService编程)
    转载 使用axis2构建webservice
    svn强制解锁的几种做法
    批处理切换当前目录的做法
    Android源码分析-点击事件派发机制
    Eclipse使用技巧总结(六)
    Eclipse使用技巧总结(五)
    Eclipse使用技巧总结(四)——代码重构专题
    Eclipse使用技巧总结(三)
  • 原文地址:https://www.cnblogs.com/kootimloe/p/14651014.html
Copyright © 2011-2022 走看看