Skip to content

Commit

Permalink
move fix texture scale to component init
Browse files Browse the repository at this point in the history
  • Loading branch information
Algorush committed Feb 24, 2024
1 parent 9653a9d commit 83afa05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/svg-extruder.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ AFRAME.registerComponent('svg-extruder', {
this.stokeMaterial = new THREE.LineBasicMaterial({
color: '#00A5E6'
});
// fix texture scale for extruded geometry
el.setAttribute('material', 'repeat: 0.01 0.01');
// set scale for extruded svg
el.setAttribute('scale', '0.05 0.05 0.05');
el.setAttribute('shadow', 'cast: true; receive: true');
Expand Down Expand Up @@ -90,7 +92,7 @@ AFRAME.registerComponent('svg-extruder', {
this.extrudeFromSVG(svgString);
if (!el.getAttribute('material')) {
// applies the default mixin material grass. If the element's material is not set via setAttribute
el.setAttribute('material', 'src:#grass-texture;repeat:0.01 0.01;roughness:1');
el.setAttribute('material', 'src:#grass-texture;roughness:1');
}
}
}
Expand Down

0 comments on commit 83afa05

Please sign in to comment.