Created
December 5, 2011 17:46
-
-
Save rossmeissl/1434529 to your computer and use it in GitHub Desktop.
Canvas element as mesh material
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
var canvas = document.createElement('canvas', { style: "background: none" }); | |
canvas.width = 400; | |
canvas.height = 25; | |
var context = canvas.getContext('2d'); | |
context.fillStyle = 'blue'; | |
context.fillText(labelText, 0, 0); | |
var material = new THREE.MeshBasicMaterial(canvas); | |
var geometry = new THREE.PlaneGeometry(400,25); | |
var plane = new THREE.Mesh( geometry, material); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment