-
-
Save HyroVitalyProtago/e22486e96b724eedbfc51c42eac59b67 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