New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SVG as texture? #1317
Comments
I think you're hitting this same issue #1305. |
I tried something based on that: var imageCanvas2 = document.createElement("canvas");
canvg(imageCanvas2, 'images/46.svg');
var imag = imageCanvas2.toDataURL('image/png');
var texture = new THREE.Texture(imag);
texture.needsUpdate = true;
//Now I have to make material from this so I could apply it to Mesh:
var cubeMaterial = new THREE.MeshBasicMaterial({
map : texture /////something like this. This throws errors.
});
cube = new THREE.Mesh(geometry, cubeMaterial); I didn't find example of this. Can you help? |
var imageCanvas2 = document.createElement("canvas");
canvg(imageCanvas2, 'images/46.svg');
var texture = new THREE.Texture(imageCanvas2);
texture.needsUpdate = true; |
Well, good thing is that this works. Bad thing is that it doesn't work on iPhone. |
My god... I can't believe how stupid. I have an SVG image which is the same color as WebView's background so that is why I didin't saw it :D |
I red this question #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:
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.
The text was updated successfully, but these errors were encountered: