Graphics Reference
In-Depth Information
droid_serif_regular.typeface.js">
</script>
<script src=".. /assets/fonts/droid/
droid_serif_bold.typeface.js">
</script>
We've already done this in the 02.09-write-text-in-3D.html example. If you
open this in your browser, you can play around with the various fonts and properties
available when creating text in Three.js. When you open the specified example you
will see something similar to the following screenshot:
How to do it...
Creating 3D text in Three.js is very easy. All you have to do is create
THREE.TextGeometry like this:
var textGeo = new THREE.TextGeometry(text,
params);
textGeo.computeBoundingBox();
textGeo.computeVertexNormals();
The text property is the text we want to write, and params define how the text is
rendered. The params object can have many different parameters, which you can
look at in more detail in the How it works… section.
Search WWH ::




Custom Search