Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
A < 20 line (Hack-ish) A-Frame Outline Geometry component
AFRAME.registerComponent('outline-geometry', {
schema : {
margin : { default : 1.025 },
color: { default : 'red' },
},
init : function () {
var p = this.el;
var p_prime = p.cloneNode(true);
p_prime.removeAttribute('outline-geometry')
p_prime.setAttribute('material', 'color', this.data.color)
p_prime.setAttribute('material', 'side', 'back')
p_prime.setAttribute('position', '0 0 0')
let s = this.data.margin
p_prime.setAttribute('scale', `${s} ${s} ${s}`)
this.el.appendChild(p_prime)
}
})
@AndresCuervo

This comment has been minimized.

Show comment Hide comment
@AndresCuervo

AndresCuervo Oct 5, 2017

Here it is in real life

oct-05-2017 01-10-30

Owner

AndresCuervo commented Oct 5, 2017

Here it is in real life

oct-05-2017 01-10-30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment