canvas - Can't add SpriteCanvasMaterial in three.js r94
问题描述
const particleMaterial = new THREE.SpriteCanvasMaterial({
color: 0x000000,
program: function(context) {
context.beginPath();
context.font = 'bold 20px Arial';
context.fillStyle = '#058';
context.transform(-1, 0, 0, 1, 0, 0);
context.rotate(Math.PI);
context.fillText(wordFont, 0, 0);
}
});
const particale = new THREE.Sprite(particleMaterial);
this.scene.add(particale);
The code above cause an error.
I just want to add some canvas shapes to three.js scene.
解决方案
推荐阅读
- ruby-on-rails - 渲染(部分)和元素之间的范围
- sparql - Dbpedia Dump 缺少值?
- php - 在 Symfony 中手动使用正确的翻译文件
- clojure - 命名空间映射命名空间上的多方法调度
- python - 基本的while循环程序
- lazy-loading - 无法使其在延迟加载模块 ngx-bootstrap-product-tour 上工作
- javascript - 从角度 5 POST 到节点 js
- python - 尝试不同的机器学习模型,预测的列表总是一样的
- c# - EWS 附加的电子邮件在 .Load() 之后缺少 DatatimeReceived 属性
- xaml - 如何在 Xamarin 表单中创建一个简单的工具栏以及左/右滑动动画