Examples: Enhance svg_sandbox with file showcase
@@ -0,0 +1,5 @@
+<svg id="color-fill" xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="300" xmlns:xlink="http://www.w3.org/1999/xlink">
+
+ <polygon class="hex" points="300,150 225,280 75,280 0,150 75,20 225,20" fill="#ff0000"></polygon>
+</svg>
@@ -178,6 +178,23 @@
}
+ // CUSTOM FROM FILE
+ var fileLoader = new THREE.FileLoader();
+ fileLoader.load( 'models/svg/hexagon.svg', function ( svg ) {
+ var node = document.createElementNS( 'http://www.w3.org/2000/svg', 'g' );
+ var parser = new DOMParser();
+ var doc = parser.parseFromString( svg, 'image/svg+xml' );
+ node.appendChild( doc.documentElement );
+ var object = new THREE.SVGObject( node );
+ object.position.x = 500;
+ scene.add( object );
+ } );
// LIGHTS
var ambient = new THREE.AmbientLight( 0x80ffff );