首页 > 解决方案 > aframe glTF cube-env-map

问题描述

我无法使用“cube-env-map”在我的 gtLF 模型上看到任何反射。我想得到这样的东西: 来自threejs.org示例的头盔 我不知道这是因为我使用的.jpg文件,还是html或链接的javascript脚本,或者......还有什么?这是我的html:

<!DOCTYPE html>
<html>
  <head>
    <script src="https://aframe.io/releases/0.8.2/aframe.min.js"></script><!-- Master file for aframe (== a-scene) -->
    <script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script><!-- webcam/mobilecam --> 
    <script src="https://mkwy.fr/js/play-all-model-animations.js"></script><!-- animation -->
    <script src="https://mkwy.fr/js/aframe-orbit-controls.min.js"></script><!-- orbit cam around target -->
    <script src="https://mkwy.fr/js/aframe-extras.js"></script><!-- cub-env-map -->
  </head>
  <body>
<a-scene vr-mode-ui="enabled: false" embedded>
     <a-assets>
     <a-asset-item id="toy" src="https://mkwy.fr/assets/toyDrummerSolo.glb"></a-asset-item>
     </a-assets>
     <a-entity 
        gltf-model="#toy"
        cube-env-map="path: https://mkwy.fr/assets/cube-env/; extension: jpg; reflectivity: 0.9;" 
        play-all-model-animations >
     </a-entity>
      <a-entity camera look-controls  orbit-controls="target: 0 1 0; minDistance: 0.5; maxDistance: 60; initialPosition: 0 5 5"></a-entity>
</a-scene>
</body>
</html>

非常感谢您的帮助,

标签: aframegltf

解决方案


好的,我更改了 Blender 中的设置,添加了金属度,现在它就像一个魅力。这很令人困惑,因为在 Blender 中你不需要设置金属度来获得反射(即:塑料瓶可能有反射)。我必须使用这些参数。非常感谢!


推荐阅读