Last active
February 13, 2020 22:27
-
-
Save cwervo/7669c10232a8aa6035ec71d9e91346a0 to your computer and use it in GitHub Desktop.
A < 20 line (Hack-ish) A-Frame Outline Geometry component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here it is ✨in real life✨