# HTML element (input form) live to threejs

**URL:** <https://discourse.threejs.org/t/html-element-input-form-live-to-threejs/24673>\
**Category:** Questions\
**Tags:** css3d, html\
**Created:** [March 23, 2021, 1:23pm UTC](https://discourse.threejs.org/t/html-element-input-form-live-to-threejs/24673 "2021-03-23T13:23:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marti\_king](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/marti_king/32/17254_2.png) [@Marti\_king](https://discourse.threejs.org/u/Marti_king)\
**Post date:** [March 23, 2021, 1:23pm UTC](https://discourse.threejs.org/t/html-element-input-form-live-to-threejs/24673/1 "2021-03-23T13:23:11Z")

</div>

Hey,

I want a input form in a 3d cube object. It should act like a normal HTML. Thanks for help!

What options are available?

Example:  
3D:  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/4/5/452f1ce5ffe55fef5b879aa94dcc4c6fbcb32312.png)

2D:  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/8/b/8b9cb18a9f7c6a5a621789aa7cf300c6c3780ab3.png)

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [March 23, 2021, 1:44pm UTC](https://discourse.threejs.org/t/html-element-input-form-live-to-threejs/24673/2 "2021-03-23T13:44:25Z")

</div>

Have you tried using `CSS3DRenderer` for this use case?

[https://threejs.org/examples/css3d\_youtube](https://threejs.org/examples/css3d_youtube)

---

<div class="post-metadata">

**Author:** ![drcmda](https://avatars.discourse-cdn.com/v4/letter/d/91b2a8/32.png) [@drcmda](https://discourse.threejs.org/u/drcmda)\
**Post date:** [March 23, 2021, 2:04pm UTC](https://discourse.threejs.org/t/html-element-input-form-live-to-threejs/24673/3 "2021-03-23T14:04:46Z")

</div>

css3drenderer. but it can be hard to use because you’ll be dealing with two separate scenes. in react this would be trivial and you’d have the ability to use real world components, for instance antd forms: [r3f basic demo (forked) - CodeSandbox](https://codesandbox.io/s/r3f-basic-demo-forked-krfol?file=/src/App.js)

the problem remains that HTML is always in front. your cube has 6 faces, they’ll all overlay one another unless you make the background opaque. that can be fixed with raycasting.

---

<div class="post-metadata">

**Author:** ![Marti\_king](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/marti_king/32/17254_2.png) [@Marti\_king](https://discourse.threejs.org/u/Marti_king)\
**Post date:** [March 23, 2021, 2:52pm UTC](https://discourse.threejs.org/t/html-element-input-form-live-to-threejs/24673/4 "2021-03-23T14:52:51Z")

</div>

I have this problem because i want to put a shipping label on a 3d package. And there then as an example would like to change the first name on the 3d model.

---

<div class="post-metadata">

**Author:** ![hofk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hofk/32/44944_2.png) [@hofk](https://discourse.threejs.org/u/hofk)\
**Post date:** [March 23, 2021, 5:02pm UTC](https://discourse.threejs.org/t/html-element-input-form-live-to-threejs/24673/5 "2021-03-23T17:02:07Z")

</div>

related

[How to set the options correctly in the select element? (CSS3DObject)](https://discourse.threejs.org/t/how-to-set-the-options-correctly-in-the-select-element-css3dobject/20365)  
[Do we need the intermediate object. (.css3dObject.)](https://discourse.threejs.org/t/do-we-need-the-intermediate-object-css3dobject/20313)  
[MixedHtmlCssWebGl](https://hofk.de/main/threejs/MixedHtmlCssWebGl/MixedHtmlCssWebGl.html)  
[GradientsMaterialColor](https://hofk.de/main/discourse.threejs/2020/GradientsMaterialColor/GradientsMaterialColor.html)

---

<div class="post-metadata">

**Author:** ![awonnink](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/awonnink/32/22486_2.png) [@awonnink](https://discourse.threejs.org/u/awonnink)\
**Post date:** [March 24, 2021, 6:00pm UTC](https://discourse.threejs.org/t/html-element-input-form-live-to-threejs/24673/6 "2021-03-24T18:00:35Z")

</div>

I use the CSS3D renderer in this example [SpaceX control room (threeml.org)](http://threeml.org/ex/space/). However, I am changing the z-index for the i-frame that is in the forefront.

---

<div class="post-metadata">

**Author:** ![awonnink](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/awonnink/32/22486_2.png) [@awonnink](https://discourse.threejs.org/u/awonnink)\
**Post date:** [March 24, 2021, 10:45pm UTC](https://discourse.threejs.org/t/html-element-input-form-live-to-threejs/24673/7 "2021-03-24T22:45:24Z")

</div>

Made a small example. So it is possible, but the CSS3D appears quite sensible to the css used.  
[Cube input (threeml.org)](http://threeml.org/ex/sqf/)

---

<div class="post-metadata">

**Author:** ![Marti\_king](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/marti_king/32/17254_2.png) [@Marti\_king](https://discourse.threejs.org/u/Marti_king)\
**Post date:** [March 25, 2021, 12:16am UTC](https://discourse.threejs.org/t/html-element-input-form-live-to-threejs/24673/8 "2021-03-25T00:16:10Z")

</div>

Wow, thank you very much. Would be cool if you upload the code to codepen or something so I can use it. I am very grateful for what nice people there are on this forum.

---

<div class="post-metadata">

**Author:** ![awonnink](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/awonnink/32/22486_2.png) [@awonnink](https://discourse.threejs.org/u/awonnink)\
**Post date:** [March 25, 2021, 8:30am UTC](https://discourse.threejs.org/t/html-element-input-form-live-to-threejs/24673/9 "2021-03-25T08:30:07Z")

</div>

I used a custom library which allows a declarative way to create the panels in ThreeJS, so I could quickly try your proposal.  
The actual work is done in the handleHtmlPlaneGeometry() function in the threeml.js library ( [threemlorg/threeml: Serviceable 3D (github.com)](https://github.com/threemlorg/threeml), but this function handles multiple usages of the CSS3D object, so might be somewhat complex to evaluate.

This article does some basic explanation: [Mixing HTML pages inside your WebGL - Learning Three.js](http://learningthreejs.com/blog/2013/04/30/closing-the-gap-between-html-and-webgl/)

You just need 6 of these panels, position and orient them correctly, and individually link them to separate html forms… Of course you can use a group geometry as parent to position and orient the complete cube.
