import { Laya3D } from "Laya3D" ; import { Laya } from "Laya" ; import { Camera } from "laya/d3/core/Camera" ; import { Sprite3D } from "laya/d3/core/Sprite3D" ; import { DirectionLight } from "laya/d3/core/light/DirectionLight" ; import { Scene3D } from "laya/d3/core/scene/Scene3D" ; import { Vector3 } from "laya/d3/math/Vector3" ; import { Stage } from "laya/display/Stage" ; import { Handler } from "laya/utils/Handler" ; import { Stat } from "laya/utils/Stat" ; author sss
  export class TestAbc { constructor ( ) { Laya3D . init ( 720 , 1280 ) ; Laya . stage . scaleMode = Stage . SCALE_FULL ; Laya . stage . screenMode = Stage . SCREEN_NONE ; Stat . show ( ) ; var resource = [ "res/threeDimen/skinModel/LayaMonkey/LayaMonkey.lh" ] ; Laya . loader . create ( resource , Handler . create ( this , this . onLoadFinish ) ) ; } onLoadFinish ( ) { var scene = ( < Scene3D > Laya . stage . addChild ( new Scene3D ( ) ) ) ; var camera = ( < Camera > ( scene . addChild ( new Camera ( 0 , 0.1 , 100 ) ) ) ) ; camera . transform . translate ( new Vector3 ( 0 , 3 , 3 ) ) ; camera . transform . rotate ( new Vector3 ( - 30 , 0 , 0 ) , true , false ) ; var directionLight = ( < DirectionLight > scene . addChild ( new DirectionLight ( ) ) ) ; directionLight . color = new Vector3 ( 0.6 , 0.6 , 0.6 ) ; directionLight . transform . worldMatrix . setForward ( new Vector3 ( 1 , - 1 , 0 ) ) ; var sp = Laya . loader . getRes ( "res/threeDimen/skinModel/LayaMonkey/LayaMonkey.lh" ) ; scene . addChild ( sp ) ; } }