Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BOX6个面中z平面的面position属性数据不正确 #16

Open
vastAndHazyAreamer opened this issue May 13, 2024 · 2 comments
Open

BOX6个面中z平面的面position属性数据不正确 #16

vastAndHazyAreamer opened this issue May 13, 2024 · 2 comments

Comments

@vastAndHazyAreamer
Copy link

获取BOX的6个面后,展开mesh.faces?.positions属性查看position,发现其位置和实际位置不相匹配,面的positon中代表高度的数据正好减去了box的高度。
位置截图
同理,mesh.edges中的position的高度也是不匹配的
边缘线位置
截图中这个box的高度为1049

@xiangechen
Copy link
Owner

单独拿出的六个面(face)的 mesh 数据是没有经过矩阵转换的原始数据,可用face.matrix转换,代码如下:

// 点
let transformedPositions = face.matrix.ofPoints(mesh.positions);
// 法向量
let transformedNormals = face.matrix.ofVectors(mesh.normals);

@vastAndHazyAreamer
Copy link
Author

我使用如下代码获取到一个未矩阵变换前的面,如何将其变换成一个矩阵变换后的位置呢
获取面
然后直接去构造它,使其能在界面中选中
面
但是原始数据的面朝z方向的面原始数据不对导致界面中选中显示的位置也不对,那么怎么将其变换成转换后正常的面呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants