这个函数转换出来的坐标z值是不是有问题啊
我对一个点连续调用getWorldToScreenPoint,然后在getScreenToWorldPoint,点的坐标居然变了
希望大佬解答一下,谢谢
cc.log(this.camera.name)
var screenPos=new cc.Vec3(0,0,0)
var worldPos=new cc.Vec3(0,0,0)
var newWorldPos=new cc.Vec3(0,0,0)
this.camera.getWorldToScreenPoint(worldPos,screenPos)
cc.log(screenPos)
this.camera.getScreenToWorldPoint(screenPos,newWorldPos)
cc.log(newWorldPos)
摄像机是3D的,布置在(0,0,100),farPlane在1024
x: 960
y: 540
z: 0.9909677419354839
x: 0
y: 0
z: -865.3807734386179
两次log的输出结果,x,y都是对的,但是z却变了。