需要有关 THREE.js TextGeometry 的帮助
不确定为什么以下代码(基本上是示例中的剪切和粘贴)返回错误。
var textWhy = new THREE.TextGeometry( "Why", { size: 10, height: 5, curveSegments: 6, font: "helvetiker", width: "normal", style: "bold" });
无法读取未定义的“正常”属性
我是 webgl 的新手,希望有人能给我指出解决方案。
谢谢。
尝试使用这个最简单的片段。结果是一样的。
<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>
Not sure why following code (basically a cut & paste from example) is returning error.
var textWhy = new THREE.TextGeometry( "Why", { size: 10, height: 5, curveSegments: 6, font: "helvetiker", weight: "normal", style: "bold" });
Cannot read property 'normal' of undefined
I am new to webgl, hope someone can point me to a solution.
Thanks.
Tried with this simplest snippet. 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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发现我不应该使用“typeface-0.15.js”,而只能使用字体 helvetiker_*.typeface.js。 Three.js 中提供了“load”函数。所以应该是:
Found that I should not use "typeface-0.15.js" but only the font helvetiker_*.typeface.js. The 'load' function is provided in Three.js. So it should be: