[]麻烦问一下3D局部坐标转换成世界坐标用那个函数?

已邀请:

w1114367261

赞同来自:

在3D中,local表示本地坐标,其他都是世界坐标

快乐之源

赞同来自:

可以参考这个示例
https://layaair.ldc.layabox.com/demo2/?language=ch&category=3d&group=Camera&name=D3SpaceToD2Space
 
private animate(): void {
        this._position.x = Math.sin(this.scaleDelta += 0.01);
        this.layaMonkey3D.transform.position = this._position;
        this.layaMonkey3D.transform.scale = this.scale;
        //转换坐标
        this.camera.viewport.project(this.layaMonkey3D.transform.position, this.camera.projectionViewMatrix, this._outPos);
        //赋值给2D
        this.layaMonkey2D.pos(this._outPos.x / Laya.stage.clientScaleX, this._outPos.y / Laya.stage.clientScaleY);
    }

要回复问题请先

商务合作
商务合作