【问题标题】:How to reverse backUVs image in Babylon.js (Y axis)?如何在 Babylon.js(Y 轴)中反转 backUVs 图像?
【发布时间】:2019-11-03 13:22:20
【问题描述】:

将我的图像分成两半并旋转后,我看到镜像,我找不到解决问题的方法。

在输入我有这样的图像:https://i.imgur.com/YBjMY49.png 在 Y 轴旋转后,我回到了这样的状态:https://i.imgur.com/agyCAiW.png

我已经尝试使用 invertY 和 multivector by -1 反转图像,但这些都不起作用。

function defineCards (imgPath, scene)
{
    let f = new BABYLON.Vector4(0.5, 0, 1, 1);
    let b = new BABYLON.Vector4(0, 0, 0.5, 1);    

    let plane = BABYLON.MeshBuilder.CreatePlane("plane", {height:1.5, width: 1.05, sideOrientation: BABYLON.Mesh.DOUBLESIDE, frontUVs: f, backUVs: b}, scene);

    let mat = new BABYLON.StandardMaterial("", scene);
    mat.diffuseTexture = new BABYLON.Texture(imgPath, scene);
    plane.material = mat;

    return plane;
}
...
...
...
animation = new BABYLON.Animation("animationPlane1", "rotation.y", 60, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);

我希望图像不会被反转。

谢谢。

【问题讨论】:

    标签: javascript animation reverse image-rotation babylonjs


    【解决方案1】:

    您需要交换第二个和第四个参数。

    而不是这个:

    let f = new BABYLON.Vector4(0.5, 0, 1, 1);
    

    你应该有这样的东西:

    let f = new BABYLON.Vector4(0.5, 1, 1, 0);
    

    【讨论】:

      猜你喜欢
      • 2013-11-04
      • 1970-01-01
      • 1970-01-01
      • 2017-12-07
      • 2022-07-07
      • 1970-01-01
      • 2017-07-30
      • 2011-01-04
      • 1970-01-01
      相关资源
      最近更新 更多