Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to render 3D text in JavaFX?

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!

like image 519
codenoob Avatar asked Sep 27 '22 22:09

codenoob


1 Answers

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.

Text3D

Under the hood there is a complex process of converting (2D) Text to Path, Delaunay triangulation and mesh extrusion.

Text3D

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.

like image 53
José Pereda Avatar answered Sep 30 '22 08:09

José Pereda