Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Aframe 如何将置换贴图应用于a帧中的平面?_Aframe - Fatal编程技术网

Aframe 如何将置换贴图应用于a帧中的平面?

Aframe 如何将置换贴图应用于a帧中的平面?,aframe,Aframe,我想在A帧中显示具有关联位移贴图的图像。我的目标是以Facebook 3D照片的风格为图像提供3D深度效果。图像和深度贴图为1024x102PNG 以下是我尝试过的: <html> <head> <script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script> <title>Displacement</title> </

我想在A帧中显示具有关联位移贴图的图像。我的目标是以Facebook 3D照片的风格为图像提供3D深度效果。图像和深度贴图为1024x102PNG

以下是我尝试过的:

<html>
  <head>
    <script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
    <title>Displacement</title>
  </head>
  <body>
    <a-scene>
      <a-assets>
        <img id="texture" src="texture.png">
        <img id="displacement" src="displacement.png">
      </a-assets>
      <a-plane
        src="#texture"
        width="250"
        height="250"
        position="0 0 -200"
        displacement-map="#displacement"
        displacement-bias="0"
        displacement-scale="60"
      ></a-plane>
    </a-scene>
  </body>
</html>

取代

这将显示带有图像纹理的平面,但它是平坦的,没有置换效果。我缺少什么?

置换贴图仅移动平面的现有顶点,即角点。为了获得贴图置换效果,需要使用
分段高度
分段宽度
属性将平面细分为较小的三角形