index.wxml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <xr-demo-viewer
  2. title="多Tracker案例"
  3. intro="点击按钮,对应不同识别效果 Marker 的添加与删除。视频纹理加载过程会有白色透明层,加载完成后直接播放。视频目前属于beta阶段,存在加载失败超时的情况,为了避免目前版本的Crash问题,每次扫描会重新拉取视频。"
  4. code=""
  5. showBackBtn="{{showBackBtn}}"
  6. >
  7. <view wx:if="{{dataReady}}">
  8. <xr-template-tracker
  9. disable-scroll
  10. id="main-frame"
  11. width="{{renderWidth}}"
  12. height="{{renderHeight}}"
  13. style="width:{{width}}px;height:{{height}}px;top:{{top}}px;left:{{left}}px;display:block;"
  14. markerListRaw="{{markerList}}"
  15. bindtrackerchange="handleTrackerChange"
  16. bindtrackermove="handleTrackerMove"
  17. />
  18. </view>
  19. <!-- Marker控制 -->
  20. <view class="xr-control" style="top: {{height}}px;">
  21. <view class="control-item {{useScan? 'active' : ''}}" bind:tap="tapScan">
  22. <view class="item-title">扫描显示识别框</view>
  23. <view class="img-wrap">
  24. <image class="hint-img" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/wxball.jpg" />
  25. </view>
  26. </view>
  27. <view class="control-item {{useGLTF? 'active' : ''}}" bind:tap="tapGLTF">
  28. <view class="item-title">扫描显示glTF</view>
  29. <view class="img-wrap">
  30. <image class="hint-img" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/portalImage.jpg" />
  31. </view>
  32. </view>
  33. <view class="control-item {{useVideo1? 'active' : ''}}" bind:tap="tapVideo1">
  34. <view class="item-title">扫描显示视频1</view>
  35. <view class="img-wrap">
  36. <image class="hint-img" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/marker/2dmarker-test.jpg" />
  37. </view>
  38. </view>
  39. <view class="control-item {{useVideo2? 'active' : ''}}" bind:tap="tapVideo2">
  40. <view class="item-title">扫描显示视频2</view>
  41. <view class="img-wrap">
  42. <image class="hint-img lh" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/marker/osdmarker-test.jpg" />
  43. </view>
  44. </view>
  45. </view>
  46. <!-- scan 提示框 -->
  47. <view class="marker-wrap" wx:if="{{showMarkerWrap}}" style="left: {{markerLeft}}%; top: {{markerTop}}%; width: {{markerWidth}}px; height: {{markerHeight}}px; margin-left: -{{markerWidth / 2}}px; margin-top: -{{markerHeight / 2}}px;">
  48. <image class="marker-img-lt" src="/assets/image/ar-box-border.png"></image>
  49. <image class="marker-img-lb" src="/assets/image/ar-box-border.png"></image>
  50. <image class="marker-img-rt" src="/assets/image/ar-box-border.png"></image>
  51. <image class="marker-img-rb" src="/assets/image/ar-box-border.png"></image>
  52. </view>
  53. </xr-demo-viewer>