[]Laya截图3D场景相关模型,导致模型透视!

重现问题条件,有一个(.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);
};
}());
已邀请:

Chenyazhi

赞同来自:

buga.png

 

Apple

赞同来自:

注意一下,不要直接采样unity里的坐标到代码里,因为Laya和Unity采用不同坐标系,所以直接抄会出现这样的问题。
如果搞不定坐标变换,把在un相机ity里摆好了再输出即可。

Apple

赞同来自:

我这里没有问题,你是不是绑了动画,动画会自动播。

Apple

赞同来自:

资源发过来我看一下

Chenyazhi

赞同来自:

aww.png

 

Chenyazhi

赞同来自:

资源,带摄像机的。

Apple

赞同来自:

我这是正面朝前的一个小人,看着没有问题。

Apple

赞同来自:

你看下你引擎版本是不是最新的

Apple

赞同来自:

爱奇艺20180504101649.png

 

Apple

赞同来自:

.pos(100,100);去掉就重叠了,完全没问题。

Chenyazhi

赞同来自:

 
(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_5_chaoren/role_5_chaoren.lh";
var sceneP = Laya.stage.addChild(new Laya.Sprite());
var scene = sceneP.addChild(new Laya.Scene());
this.effRes = Laya.Sprite3D.load(resUrl);
this.effRes.on(Laya.Event.HIERARCHY_LOADED, this, function(){
this.eff1 = scene.addChild( Laya.Sprite3D.instantiate(this.effRes));
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();
sp.graphics.drawTexture(texture);
Laya.stage.addChild(sp);
};
}());

龙某人

赞同来自:

老哥  你的这个问题解决了吗,我这边也出现这个问题,尝试了没找到解决办法

要回复问题请先

商务合作
商务合作