ThreeJS几何翻转 [英] ThreeJS geometry flipping
本文介绍了ThreeJS几何翻转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我遇到了几何翻转问题,我尝试使用负比例技术进行翻转,但失败了.
I am facing a problem with geometry flipping, I tried flipping using the negative scale technique but it fails.
我可以使用什么技术在特定轴上翻转 3d 对象?
What is the technique that I can use to flip a 3d object across specific axis?
翻转是指对象看起来应该像在镜子上渲染一样.
By flipping I mean the object should look as it was rendered over a mirror.
如果这无法通过three.js渲染实现,我该如何使用Blender来实现?
if this is not possible through three.js rendering how can I use Blender to achieve this?
推荐答案
您必须将变换矩阵应用于几何(或网格/对象),这里是平面 (O, y, z) 对称的示例,您可以适应您的具体情况
You have to apply a transformation matrix to the geometry (or mesh/object), here is an example for plannar (O, y, z) symetry, you can adapt for your specific case
var mS = (new THREE.Matrix4()).identity();
//set -1 to the corresponding axis
mS.elements[0] = -1;
//mS.elements[5] = -1;
mS.elements[10] = -1;
geometry.applyMatrix(mS);
//mesh.applyMatrix(mS);
//object.applyMatrix(mS);
这篇关于ThreeJS几何翻转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文