Need help on THREE.js TextGeometry

Not sure why the following code (basically cut and paste from the example) returns an error.

var textWhy = new THREE.TextGeometry ("Why", {size: 10, height: 5, curveSegments: 6, font: "helvetiker", weight: "normal", style: "bold"});

Unable to read the "normal" property from undefined

I am new to webgl, hope someone can point me to a solution.

Thank.

I tried this simplest fragment. The result is the same.

<html>
<head>
<title>Three.js Why Text</title>
<script src="typeface-0.15.js"></script>
<script src="helvetiker_regular.typeface.js"></script>
<script src="helvetiker_bold.typeface.js"></script>
<script type="text/javascript" src="Three.min.js"></script>
<script type="text/javascript" src="jquery-1.7.1.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        textWhy = new THREE.TextGeometry( "Why", { size: 10, height: 5, curveSegments: 6, font: "helvetiker", weight: "normal", style: "normal" });
    });
</script>
</head>
<body>
</body>
</html>
+5
source share
1 answer

It was discovered that I should not use "font-0.15.js", but only the font helvetiker _ *. typeface.js. The "load" function is provided in Three.js. Therefore, it should be:

<html>
<head>
<title>Three.js Why Text</title>
<script type="text/javascript" src="Three.min.js"></script>
<script src="helvetiker_regular.typeface.js"></script>
<script src="helvetiker_bold.typeface.js"></script>
...
+8
source

All Articles