Zack,
 
For your second question, I just thought I'd remind you that in Text3D, characters are displayed as one meter high per point in the size of the font. So a 12-point font extrudes 12-meter high characters.
 
-Allan 
----- Original Message -----
From: Zack FC
Sent: Monday, March 24, 2003 11:49 PM
Subject: [JAVA3D] Display Filename Problem in 3DFM

Recently I am developing a 3D file manager. But the problem facing now is filename positioning problem. Since all filenames have different length, and collision or overlapping of objects in java 3d virtual universe would not be rendered. So I fix the position of the reference point of Text2D object exactly same as the cube reference point. But however this method does not produce good result in the scene. For example if the filename is too long, it will overlap with the filename which is next to it.

 

1. Can I display the file name on the cube’s (file) surface? That means a cube will display 6 filename of it instead of one. And if the filename is too long, it will wrap to the next line so that the filename won’t overlap with each other.

 

2. Text 3D problem. Code shows the basic construction of a Text3D object.

 

public TransformGroup createFileName3D() {

Font3D font3d = new Font3D(new Font(font, Font.BOLD, 12), new FontExtrusion());

    Text3D text3d = new Text3D(font3d, s);

    Shape3D textObject = new Shape3D(text3d);

    Transform3D textTranslation = new Transform3D();

textTranslation.setTranslation(new Vector3f(tr.x - 0.5f, tr.y + 0.1f, tr.z   + 0.5f));

    TransformGroup textTranslationGroup = new TransformGroup(textTranslation);

    textTranslationGroup.addChild(textObject);

    System.out.println("createFileName3D of" + s + " at " + tr);

    return textTranslationGroup;

}

 

however i failed to figure out how to change the size of the Shape3D object. The result output of the Text3D object was very huge and overlapped with the cubes and platform in the scene.

 

3. The picking behavior also got problem. In response to the mouse event, whenever the mouse button is clicked, the filename of the cube, which is the text string s will be sent to the system output in the Java console. This attempt was supposed to be successful, as there was some output in the Java console. However, the output was not a single filename, instead all filename in the directory were displayed as well.

 

I have attached the attachment. Please give me some commend on the prototype. The core class is TdBrowser. Please help.

 

Sincerely 

Zack



Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!

Reply via email to