【发布时间】:2020-08-14 17:56:31
【问题描述】:
我正在做一个 hitTest 以在一个面法线上创建一个剖面。为了获得全局正常,我必须对hitTest.face.normal 进行一些修改。它似乎几乎工作,但我的结果似乎与实际正常略有不同,所以我认为我做错了什么:
const normalMatrix = new THREE.Matrix3().getNormalMatrix( this.hitTest.object.matrixWorld );
const normal = this.hitTest.face.normal.clone().applyMatrix3( normalMatrix )
this.SectionExtension.tool.setSectionPlane(normal, this.hitTest.point)
As seen on the picture, my ending cut plane is slightly off the actual plane
任何人都可以看到以这种方式获得飞机可能会出现什么问题,或者有没有人有更好的方法来找到全球常态?
提前谢谢你!
【问题讨论】:
-
你能用这个代码试试吗:
const normal = this.hitTest.face.normal.clone();然后normal.transformDirection( this.hitTest.object.matrixWorld );? -
相同的结果.. 已经进行了更多测试 - 如果面孔相当简单且正常接近干净的 X/Y/Z 向量,那么我没有任何问题。会不会是容忍问题?我不知道 Autodesk-forge 的容差,但我可以看到面法线有相当多的小数点 - 所以我猜某种四舍五入可能会使我的剖面像这样稍微偏离?
标签: three.js autodesk-forge autodesk-viewer