Skip to content

Instantly share code, notes, and snippets.

@ubaltaci
Created September 17, 2014 12:27
Show Gist options
  • Save ubaltaci/7164cebd739768d06d86 to your computer and use it in GitHub Desktop.
Save ubaltaci/7164cebd739768d06d86 to your computer and use it in GitHub Desktop.
three.js 3d text
var text3d = new THREE.TextGeometry("123123123131", {
size: 0.2,
height: 0.1,
font: 12
});
text3d.computeBoundingBox();
var material = new THREE.MeshFaceMaterial([
new THREE.MeshPhongMaterial({color: 0xffffff, shading: THREE.FlatShading}), // front
new THREE.MeshPhongMaterial({color: 0xffffff, shading: THREE.SmoothShading}) // side
]);
var text = new THREE.Mesh(text3d, material);
text.name = mesh.name;
text.position.x = 0;
text.position.y = 3;
text.position.z = 0;
text.rotation.x = -Math.PI / 2;
map.add(text);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment