【发布时间】:2020-11-25 10:09:55
【问题描述】:
我想让用户网络摄像头作为简单的背景(== 没有跟踪、标记...) 使用以下代码,我得到了它,但网络摄像头背景上没有阴影。 我想我不应该使用 aframe-ar.js,我可以看到这个示例显示了映射在立方体上的网络摄像头: webcam as aframe texture
但是如何将网络摄像头作为简单的背景?然后如何让这个背景上的阴影可见?
<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><!-- display webcam -->
<script src="../js/play-all-model-animations.js"></script><!-- play animation -->
<script src="../js/aframe-orbit-controls.min.js"></script><!-- orbit cam target -->
<script src="../js/aframe-extras.js"></script><!-- pour cub-env-map -->
</head>
<body>
<a-scene vr-mode-ui="enabled: false" embedded>
<a-assets>
<a-asset-item id="toy" src="../assets/toyDrummerSolo-03.glb"></a-asset-item>
</a-assets>
<a-entity gltf-model="../assets/toyDrummerSolo-03.glb" play-all-model-animations="" shadow="" id="gltf">
</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-entity id="keylight" light="type:point;intensity:2;castShadow:true;shadowCameraFar:100;shadowBias:-0.001;shadowMapHeight:2048;shadowMapWidth:2048;" position="2.40512 2.77634 2.73113"></a-entity>
<a-entity id="ambient" light="type:hemisphere;color:#e5fdff;groundColor:#ffffff;intensity:0.5" visible=""></a-entity>
</a-scene>
<!-- no shadow on the webcam background -->
</body>
</html>
【问题讨论】:
标签: background webcam aframe shadow