aframe-htmlmesh
aframe-htmlmesh copied to clipboard
Backdrop proposal for readibility
As background seems to be transparent by default sometimes having a backdrop helps, in particular when there is text.
const geometry = new THREE.PlaneGeometry( el.object3D.children[0].geometry.parameters.width*1.1,
el.object3D.children[0].geometry.parameters.height*1.1 );
const material = new THREE.MeshBasicMaterial( {color: 0xffffff, side: THREE.DoubleSide} );
const plane = new THREE.Mesh( geometry, material );
plane.position.z = -.1
el.object3D.add( plane );
I tend to use this relatively often. If useful to others could be an optional, disabled by default, parameter for the component. Itself with color as a parameter.
My suggested method would be to set a background color for the root element being used but it seems nice that it has a little a offset, if you would like to add this feature as a PR I wouldn’t mind merging it.