将矩阵应用于 sphere/Object3D
Apply matrix to sphere/Object3D
我有一个 360° 全景图片(纹理),我围绕一个球体进行映射,并将我的相机放在球体内以进行球面投影。现在纹理被投射到球体的外部。
我想 'turn the texture inside-out' 我读到它可以通过应用矩阵来完成。
我想将矩阵应用于 Rajawali/OpenGL 中的球体 (Object3D)。
这可以在 ThreeJS 中完成,如下所示:
var sphere = new THREE.SphereGeometry(100, 100, 40);
sphere.applyMatrix(new THREE.Matrix4().makeScale(-1, 1, 1));
three.js applyMatrix 文档:
this updates the position, rotation and scale with the matrix.
我想在 Rajawali 中这样做:
mSphere = new Sphere(100, 100, 40);
//Apply the matrix here
可在此处找到 Matrix/Object3D 的文档
Matrix4
Object3D
或者有其他方法可以做到吗?
已修复!
mSphere = new Sphere(100, 100, 40);
mSphere.setScaleX(-1);
mSphere.setScaleY(1);
mSphere.setScaleZ(1);
这真的不是material.side的工作吗?
引自 three.js 文档 Material:
.side
Defines which of the face sides will be rendered - front, back or both.
Default is THREE.FrontSide. Other options are THREE.BackSide and THREE.DoubleSide.
所以从内部观察球面应该使用 THREE.BackSide.
我有一个 360° 全景图片(纹理),我围绕一个球体进行映射,并将我的相机放在球体内以进行球面投影。现在纹理被投射到球体的外部。 我想 'turn the texture inside-out' 我读到它可以通过应用矩阵来完成。
我想将矩阵应用于 Rajawali/OpenGL 中的球体 (Object3D)。
这可以在 ThreeJS 中完成,如下所示:
var sphere = new THREE.SphereGeometry(100, 100, 40);
sphere.applyMatrix(new THREE.Matrix4().makeScale(-1, 1, 1));
three.js applyMatrix 文档:
this updates the position, rotation and scale with the matrix.
我想在 Rajawali 中这样做:
mSphere = new Sphere(100, 100, 40);
//Apply the matrix here
可在此处找到 Matrix/Object3D 的文档 Matrix4 Object3D
或者有其他方法可以做到吗?
已修复!
mSphere = new Sphere(100, 100, 40);
mSphere.setScaleX(-1);
mSphere.setScaleY(1);
mSphere.setScaleZ(1);
这真的不是material.side的工作吗?
引自 three.js 文档 Material:
.side
Defines which of the face sides will be rendered - front, back or both. Default is THREE.FrontSide. Other options are THREE.BackSide and THREE.DoubleSide.
所以从内部观察球面应该使用 THREE.BackSide.