AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Text3D

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java
View previous topic :: View next topic  
Author Message
Petra Neumann
Guest





PostPosted: Fri Jul 25, 2003 1:39 pm    Post subject: Text3D Reply with quote



Hi,

I have a problem using Text3D.
I have several labels for objects in my scene and set up a button to
turn those labels on and off (make them visible and invisible). When I
turn the labels off and then back on they seem to have moved to
arbitrary points in my 3d scene, mostly the origin. This is really odd
since I only influence the setVisible rendering attribute not any of the
transformgroups.
Has anything like this happened to anyone before?
Here is some of my code if this helps...

Petra

I set up several Text3D objects like this:

***********method in which the text is created*****************
private Shape3D setText(String text,float x,float y,float z,int fontSize){

Font f=new Font("Helvetica",Font.PLAIN,fontSize);

Text3D am=new Text3D(new Font3D(f,new FontExtrusion()),text,new
Point3f(x,y,z));

Shape3D t=new Shape3D();
t.setGeometry(am);

Appearance app=new Appearance();
Color3f textColor=new Color3f(0.6f,0.6f,0.6f);
ColoringAttributes coloringAttributes = new ColoringAttributes( );
coloringAttributes.setColor( textColor );
coloringAttributes.setShadeModel( ColoringAttributes.SHADE_FLAT );

app.setColoringAttributes( coloringAttributes );

t.setAppearance(app);

return t;
}


**********where the method is called:
Shape3D label=setText(text,0.0f,lp+lp/10f-cy,0.0f,fontsize);

//sphereLabelText[...]stores all my labels
sphereLabelText[id]=label;

//set rendering attributes
sphereLabelText[id].getAppearance().setRenderingAttributes(r);
sphereLabelText[id].setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
sphereLabelText[id].setCapability(Shape3D.ALLOW_APPEARANCE_READ);
sphereLabelText[id].getAppearance().setCapability(Appearance.ALLOW_RENDERING_ATTRIBUTES_READ);
sphereLabelText[id].getAppearance().setCapability(Appearance.ALLOW_RENDERING_ATTRIBUTES_WRITE);
sphereLabelText[id].getAppearance().getRenderingAttributes().setCapability(RenderingAttributes.ALLOW_VISIBLE_READ
);
sphereLabelText[id].getAppearance().getRenderingAttributes().setCapability(RenderingAttributes.ALLOW_VISIBLE_WRITE
);

Group sphereLabel=new Group();
sphereLabel.addChild(sphereLabelText[id]);
sphereLabel.addChild(sphereLabelSticks[id]);

//this group is then added to a transformgroup


**********how the labels are made visible and invisible*****
sphereLabelText[id].getAppearance().getRenderingAttributes().setVisible(false);

Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.