Hi everybody,

I have a virtual Universe with several objects, including a layer with
Text3D-Objects.
For better visual analysis result I am wanting to give the user the
possibility to scale all objects.
So I added a TransformGroup just behind my first BranchGroup in the scene
graph.

        BranchGroup root = new BranchGroup();
        TransformGroup scaleTG = new TransformGroup();
        Transform3D scale = new Transform3D();
        scale.setScale(new Vector3d(1,5,1));
        scaleTG.setTransform(scale);
        // scene includes the rest of the scene graph
        scaleTG.addChild(scene);
        root.addChild(scaleTG);
        u.addBranchGraph(root);


All Objects are scaled including the height of the Text3D Objects.

 Font3D font3d = new Font3D(new Font("Helvetica",Font.PLAIN,25),new
FontExtrusion());
            Float height = new Float(point3f[i].y);
            Text3D textGeom;
            textGeom = new Text3D(font3d,string[i],new
Point3f(eastValues[i],heightValues[i],-northValues[i]),align,Text3D.PATH_RIGHT);
            textGeom.setCapability(Geometry.ALLOW_INTERSECT);
            Shape3D textShape = new Shape3D(textGeom);
            Appearance textApp = new Appearance();

textApp.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_READ);

textApp.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_WRITE);
            textApp.setCapability(Appearance.ALLOW_MATERIAL_WRITE);
            textApp.setCapability(Appearance.ALLOW_MATERIAL_READ);

textApp.setCapability(Appearance.ALLOW_TRANSPARENCY_ATTRIBUTES_READ);

textApp.setCapability(Appearance.ALLOW_TRANSPARENCY_ATTRIBUTES_WRITE);
            ColoringAttributes colatt = new
ColoringAttributes(1.0f,0.0f,0.0f,ColoringAttributes.SHADE_GOURAUD);
            colatt.setCapability(ColoringAttributes.ALLOW_COLOR_READ);
            colatt.setCapability(ColoringAttributes.ALLOW_COLOR_WRITE);
            textApp.setColoringAttributes(colatt);
            Color3f black = new Color3f(0.0f,0.0f,0.0f);
            Color3f red = new Color3f(1.0f,0.0f,0.0f);
            Material material = new Material(red,black,red,black,10f);
            material.setCapability(Material.ALLOW_COMPONENT_READ);
            material.setCapability(Material.ALLOW_COMPONENT_WRITE);
            textApp.setMaterial(material);
            textShape.setAppearance(textApp);
            textShape.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
            textShape.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);

            this.addShape(textShape);


How can I prevent Text3D from scaling? The coordinates, where Text3D
should be scaled and so Text3D is showing up at the right place, only that
it is kind of stretched.

What about using Text2D? Would it be helpful? I was thinking about
changing the labelling anyway.
Approach is to see the labels always from the front and always in the same
legible size, even during rotating the view platform. My  objects live
somewhere around x = 3 000 000 and y = -5 000 000 and I did not manage to
display a Text2D around there, until now.
Is there an example of Text2D-Labelling far away from the origin?

Thanks for your help in advance

Desiree

o------------------------------------------------------------------------o
| Desiree Hilbring      Institut fuer Photogrammetrie und Fernerkundung  |
|                       Universitaet Karlsruhe, Germany                  |
|                                                                        |
|                       email: [EMAIL PROTECTED]             |
|                       # 0721 6083676                                   |
o------------------------------------------------------------------------o

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to