三.CanvasTexture需要更新没有帮助 [英] THREE.CanvasTexture needsUpdate no helps

查看:38
本文介绍了三.CanvasTexture需要更新没有帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  • 我有视频标签,他播放简单的视频.[作品]
  • 我有canvas2d可以播放相同的视频[作品]
  • opencvjs视频处理(画布输出,视频输入)-也可以工作
  • 我有three.js带有平面网格
          texture = new THREE.CanvasTexture(this.$refs.testcanvas)
          texture.needsUpdate = true;
          materialLocal = new THREE.MeshBasicMaterial({ map: texture })
          materialLocal.needsUpdate = true;
          materialLocal.map.needsUpdate = true;
          this.mainVideoMesh.material = materialLocal
          this.mainVideoMesh.material.needsUpdate = true;

没有帮助.我只有第一个图像屏幕纹理,然后停止更新.

No hepls . I got just first image screen texture and than stops updating.

在运行时我发现->

In runtime i found ->

  this.scene.children[2].material.map.needsUpdate: undefined

奇怪的情况有任何建议.

Strange situation any suggestion.

推荐答案

将视频用作纹理的数据源时,想法是使用

When using a video as a data source for a texture, the idea is to use the THREE.VideoTexture class. This type of texture will automatically manage its needsUpdate flag in order to ensure new frames are correctly displayed on your plane mesh.

使用 THREE.VideoTexture 要求您将video元素用作参数,而不是画布.

Using THREE.VideoTexture requires that you use the video element as an argument, not the canvas.

这篇关于三.CanvasTexture需要更新没有帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆