I am currently wondering if there is no node in Xith that is already capable of displaying text like Text3D/Font3D in J3D (i.e. a special primitive). Any suggestions?
Thanks in advance,
Stefan
I am currently wondering if there is no node in Xith that is already capable of displaying text like Text3D/Font3D in J3D (i.e. a special primitive). Any suggestions?
Thanks in advance,
Stefan
Can’t find any.
Possible workaround:
Use a 3D - modeller to create the letters/text and import them / it to make a text.
Investigate sun’s Java3D java3d-utils-src.jar (can’t remember if Text3D is really in there) and reimplement it.
hth
Martin
[quote]Can’t find any.
[/quote]
Me too 
And since I was unable to find any source code for java3d-sdk (except the utilities) I had to use good old jad and found some classes (e.g. GeometryArrayRetained) that where not decompilable in total. I think I will use 2D-panes with textures for any char in the meantime which is far away from being perfect …
PS: Many 3D-Modelers do allow Font extrusion. Maybe anybody knows an open source project that could contain some code?
I’m not sure what exactly you need but you can check jMonkey Engine’s (jME) source code, it’s open sourced java gaming engine that uses lwjgl. jME has nice API for adding 2d text on the screen.
http://www.mojomonkeycoding.com/
Here’s a physics demo that contains some console texts
@Jani: Thanks for the info. I will keep that in mind.
Unfortunately that is not what I am looking for currently. I am searching for a simple 3D-object that can display any string and itself is a subclass of Shape3D or at least a Geometry for that (i.e. something like Text3D in Java3D but for usage with Xith).
<=> I would like to have one object for each char that is not a plain texture on a cube but a real 3D character without doing more than specifying the Font and the text itself.
What about creating all the individuals symbols of the alphabet (A-Z for instance) as 3d models in 3d studio (for example), and one could have a small method to just assemble the objects on a scene in the correct order to form 3d text. It might be a good workaround… (you could even add each letter object to a transform group to scale, rotate and so on)
I’m interested in adding the same functionality to my program. So it would be a nice if some one comes up with a good method. If I’m able to implement anything, I will let the forum know 
@akada: You are right - that would be a workaround for the moment - though it lacks the possibilty for choosing from different fonts coming with java already.
Indeed the 3DS-loader works okay (dispite the fact that all objects are rotated by 90 degrees by default when loaded). And Xith is already capable of duplicating any node - therefore it is possible to cache objects for all characters and build up the text. So code may look like (just an idea - have not tried it):
public class 3DSString extends Group();
{
// add code for loading the objects into hashtable or equivalent
// just a method for setting the text:
public void setText(String text)
{
for (int i = 0; i < bla.length(); i++)
addChild(getObjectForCharacter(text.charAt(i));
}
/* getObjectForCharacter will do a lookup in hashtable
and clone the matching object by using aNode.sharedCopy(Node node)
Also we will have to use Transform3D and TransformGroup for moving each new character to the right position.
And a step beyond: One single line of text will be simple but what about floating text, multi-line support, automatic linefeed etc. - just dreaming of a notepad in 3d
*/