- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经做了好几个小时的谷歌搜索,看看是否可以做到在 three.js 环境中。
我想创建一个基于 TextGeometry 的发光效果,而不是像下面 Lee StemKoski 中类似的球体或立方体对象这样的简单基元 - 下面的阴影发光示例。
我一直在阅读和试验 Lee StemKoski examples
特别是他的 Shader Glow example如前所述,它适用于简单的对象,但不适用于复杂的几何形状。因此,我想知道是否有任何变通方法可以解决这个问题或其他关于如何在文本周围创建发光效果的建议。
问候
w9914420
更新:我决定通过将图像附加到文本来使用映射概念,我可以创建发光效果。在此示例中,我使用了一个圆圈,但为我需要的文本制作 map 应该不会太难。
更新:2017 年 3 月 20 日 - 所以我尝试使用 theeX.atmosphere Material 来创建难以捉摸的文本发光效果。以下是部分结果。
正如您所看到的那样——我遇到的问题是我无法进一步平滑外发光文本的顶点。我不确定是否有任何建议值得赞赏。
用于创建效果的 native 代码。
//normal text created
var geometry2 = threeLab.asset.simpleText('hello','my_font');
var materialme = new THREE.MeshNormalMaterial();
var mesh = new THREE.Mesh( geometry2, materialme );
this.scene.add( mesh );
// we create a secondary text object to use as glow
var geometry = threeLab.asset.simpleText('hello','my_font');
// clone for manipulation
var geoclone = geometry.clone();
//Thes functions are need to make it work in this case
geoclone.mergeVertices();
//geoclone.computeCentroids();
geoclone.computeVertexNormals();
geoclone.computeFaceNormals();
// part of threex library to make the glow scale and expand
THREEx.dilateGeometry(geoclone, 0.5);
var materialz = THREEx.createAtmosphereMaterial();
var meshHalo = new THREE.Mesh(geoclone, materialz );
//we have now our glow
this.scene.add( meshHalo );
最佳答案
所以最后我增加了辅助 TextGeometry 对象的 bevelsegments,这有助于平滑它。然后我就可以像这样将我的第一个文本封装到第二个文本中:
通过进一步调整,我将能够获得更微妙的发光效果,但目前效果还可以。
谢谢大家的意见:)
关于javascript - 在 Three.js 中对 THREE.TextGeometry 对象应用发光效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42820017/
我正在研究 ThreeJS geometry canvas text .单击 html 按钮后,文本应该更改为另一个文本。但是,它不起作用。如何更改 TextGeometry on click 事件?
我已经使用 THREE.TextGeometry 在我的场景中添加了一些文本,并且文本似乎卡在我放置它的任何 xy 平面中。有什么方法可以让它始终与用户可读的屏幕保持一致? 最佳答案 尝试 mesh.
我正在尝试在文本几何的帮助下创建一个时钟。为了更新时间,我需要更新文本几何中的文本,这可以通过删除并重新创建新的文本几何来完成。 每次我添加新的文本几何图形时,它都会卡住我的浏览器: // Remo
我正在尝试将光线转换到 TextGeometry 的边界框。当前,当单击不在字母周围或字母之间的字母时,光线转换适用于 textGeometry。如果单击在文本字母/字母表之间,则没有对象与 inte
我最近开始研究 three.js,现在我面临着 textgeometry 的问题。我使用的是 three.js 75 版,我使用的是 js/helvetiker_bold.typeface.js 字体
我正在尝试使用 Three.js 示例提供的已加载 typeface.js 字体,但我不断收到以下错误: Uncaught TypeError: this.addShapeList is not a
我从 TextGeometry 创建了新的 Mesh 并将其插入网格数组: var text3d = new THREE.TextGeometry( "Hello!", { font: "he
我正在使用 Three.js 开发尺寸标注工具。我想在两个对象之间的一条线上写出距离的尺寸。我想写 2.455 如图所示。 遗憾的是,Threejs R88 中的 HTML 编码无法获取,例如 Tex
我按照演示代码操作,但无法绘制 TextGeometry。字体文件存在于服务器上。 var loader = new THREE.FontLoader(); loader.load(
我在 Three.js r74 中的 TextGeometry 有一些问题。 我如何正确实现它? 这是我的 Codepen: codepen.io/cheesyeyes/pen/eJqZxK 提前致谢
如何在 Three.js 中添加文本?我已经尝试过这段代码,但它产生了错误 Uncaught TypeError: Cannot read property 'offsetX' of undefine
我是 ThreeJS 的新手,正在努力学习,所以我基本上创建了一个呈现 3D 的文本,我正在使用 TextGeometry,我需要该对象的大小(如宽度/高度)以始终将对象居中。 我正在尝试这样;
不知道为什么下面的代码(基本上是示例中的剪切和粘贴)返回错误。 var textWhy = new THREE.TextGeometry( "Why", { size: 10, height: 5,
我需要在我的 threejs 项目中渲染一些文本,但是每次我添加模块时 import { FontLoader } from 'https://threejs.org/examples/jsm/loa
我需要在我的 threejs 项目中渲染一些文本,但是每次我添加模块时 import { FontLoader } from 'https://threejs.org/examples/jsm/loa
我已经做了好几个小时的谷歌搜索,看看是否可以做到在 three.js 环境中。 我想创建一个基于 TextGeometry 的发光效果,而不是像下面 Lee StemKoski 中类似的球体或立方体对
我正在尝试使用 three.js TextGeometry 为 unicode 文本制作动画。 文字是:“Saint-Étienne-du-Mont”它在 Canvas 中显示为“Saint-??ti
我正在使用 WebGL、three.js 和 THREE.TextGeometry 制作一些 3D 文本。到目前为止一切正常。我能够创建单行 3D 文本。 现在我想创建多行文本,比如一个短段落。最好,
我是一名优秀的程序员,十分优秀!