mrdoob/three.js — Issue #1317: SVG as texture?
Author: Dino4674
Created: 2012-02-12 15:31:46+00:00
State: open

I red this question https://github.com/mrdoob/three.js/issues/814

And also I run onto this js library: http://code.google.com/p/canvg/ which can do SVG to canvas to data conversion.

This is my code:

var imageCanvas2 = document.createElement("canvas");
canvg(imageCanvas2, 'images/46.svg');
var imag = imageCanvas2.toDataURL('image/png'); // --> here is the converted image data

var cubeMaterial = [new THREE.MeshBasicMaterial({
map : THREE.ImageUtils.loadTexture(imag)
})];

This gives me error: "Cross-origin image load denied by Cross-Origin Resource Sharing policy."

What are my options here?

Also I should mention that WebGL is not an option since I will be using this on mobile devices which don't support WebGL.