找到方法了~文档没看仔细
怎么样在XR-FRAME中的ai相机里,给图片素材添加点击事件?想要在AR里的随机位置生成图片,并且可以对图片进行点击,但是发现xr-mesh没有点击或者触摸事件?试了下给xr-mesh包一层block或者xr-node,都没法成功绑定点击或触摸事件,是我的方式不对吗?还是没有办法实现这种功能? <xr-scene ar-system="modes:threeDof" bind:ready="handleReady" bind:ar-ready="handleARReady"> <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded"> <xr-asset-load type="gltf" asset-id="gltf-item" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/just_a_girl/index.glb" /> <xr-asset-load type="texture" asset-id="waifu" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/waifu.png" /> </xr-assets> <xr-gltf model="gltf-item" position="-1 0 1" scale="0.006 0.006 0.006" bind:touch-shape="handleTouchGltf"></xr-gltf> <xr-node> <block wx:for="{{meshes}}" wx:key="index"> <xr-node bind:touch-shape="handleTouchModel"> <!-- 想在这里绑定点击或触摸事件 --> <xr-mesh geometry="plane" position="{{item.position}}" rotation="{{item.rotation}}" scale="0.6 0.6 0.6" uniforms="u_baseColorMap: waifu" bindtap="handleTouchModel"></xr-mesh> </xr-node> </block> <xr-camera id="camera" node-id="camera" clear-color="0.925 0.925 0.925 1" background="ar" is-ar-camera ></xr-camera> </xr-node> <xr-node node-id="lights"> <xr-light type="ambient" color="1 1 1" intensity="1" /> <xr-light type="directional" rotation="180 0 0" color="1 1 1" intensity="3" /> </xr-node> </xr-scene>
2023-10-13