重现问题条件,有一个(.lh)后缀模型资源。
具体代码如下:
(function () {
Laya3D.init(0, 0, true);
Laya.stage.scaleMode = Laya.Stage.SCALE_FULL;
Laya.stage.screenMode = Laya.Stage.SCREEN_NONE;
var resUrl = "../bin/res/modles/role_48_lurenyi/role_48_lurenyi.lh";
var scene = Laya.stage.addChild(new Laya.Scene());
var camera = scene.addChild(new Laya.Camera(0, 0.1, 100));
camera.transform.position = new Laya.Vector3(0, 0, 10);
camera.transform.rotate(new Laya.Vector3(0, 180, 0), true, false);
camera.orthographic = true;
camera.orthographicVerticalSize = 5;
this.effRes = Laya.Sprite3D.load(resUrl);
this.effRes.on(Laya.Event.HIERARCHY_LOADED, this, function(){
this.eff1 = scene.addChild( Laya.Sprite3D.instantiate(this.effRes));
this.eff1.transform.position = new Laya.Vector3(0,0,50);
this.eff1.transform.rotate(new Laya.Vector3(0, 60, 0), true, false);
Laya.timer.callLater(this, screenShot);
});
function screenShot(){
var htmlCanvas = Laya.stage.drawToCanvas(Laya.RenderState.clientWidth,Laya.RenderState.clientHeight,0,0);
var texture = new Laya.Texture(htmlCanvas);
var sp = new Laya.Sprite().pos(100,100);
sp.graphics.drawTexture(texture);
Laya.stage.addChild(sp);
};
}());