最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Display HTML div in three.js - Stack Overflow

programmeradmin0浏览0评论

I am trying to show HTML content on the sides of a cube. This entire project is for an Oculus Rift DK2 (using three.js).

Till now, I have worked by taking a screenshot and then loading that image on the TextureLoader. Is it possible to directly show HTML content on the sides of the cube ?

I am trying to show HTML content on the sides of a cube. This entire project is for an Oculus Rift DK2 (using three.js).

Till now, I have worked by taking a screenshot and then loading that image on the TextureLoader. Is it possible to directly show HTML content on the sides of the cube ?

Share Improve this question asked Mar 11, 2016 at 5:02 Vin2k2Vin2k2 311 silver badge3 bronze badges 2
  • 1 developer.mozilla/en-US/docs/Web/API/Canvas_API/…, but with additional plication of WebGL. – andars Commented Mar 11, 2016 at 5:10
  • Is there any way to achieve it directly by using three.js ? – Vin2k2 Commented Mar 11, 2016 at 5:44
Add a ment  | 

1 Answer 1

Reset to default 5

You can use a THREE.CSS3DObject to do this. As MrDoob himself explains here:

The CSS3DObject basically extends Object3D and adds a element property.

There are several CSS3D examples here on the three.js examles page.

One of them is this YouTube example that loads youtube movies in iFrames on a geometry and shows the great possibilities of this object.

Here a link to a nice tutorial that will help you achieve your goal.

发布评论

评论列表(0)

  1. 暂无评论