如何在JavaFX中渲染3D文本? [英] How to render 3D text in JavaFX?
问题描述
我正在制作我的第一个JavaFX项目,我需要渲染一些3D文本。我已经放置了一个PerspectiveCamera并且我显示了一个文本节点,但它的Z维度为0,我不知道如何更改它。
提前致谢!
看一下
引擎盖下有一个复杂的过程,即转换(2D)文本到路径,Delaunay三角剖分和网格挤出。
因此,你有一个3D网格可以容易渲染和纹理(纯色,密度图,图像)。
看看示例,以帮助您入门。
I'm making my first JavaFX project and I need to render some 3D text. I already put a PerspectiveCamera and I display a text node but it has a Z-dimension of 0 and I don't know how to change this.
Thanks in advance!
Have a look at the FXyz project. It already contains a Text3DMesh class that will allow you generating a 3D mesh for any string and font you need.
Under the hood there is a complex process of converting (2D) Text to Path, Delaunay triangulation and mesh extrusion.
As a result, you have a 3D mesh that can be easily rendered and textured (solid color, density map, images).
Have a look at the sample to get you started.
这篇关于如何在JavaFX中渲染3D文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!