Hi Phelim,

you have to identify the Shape3D node that contains the geometry you
want to map
the texture to.  I don't know about your original file format, but e.g.
in
VRML you can attach labels to single nodes and reference the equivalent
nodes
in Java3D. The named objects are collected in a hashtable.
If you can title the geometry in the source file, try this:

Hashtable namedObjects = s.getNamedObjects();
Shape3D node = (Shape3D) namedObjects.get( "yourName");
node.setAppearance( app);


hope that helps

regards

Britt




PK wrote:
>
> Hello,
>
>     I'm working with loading in an object file, I can load in the file OK,
> but I don't know how to go about doing stuff like texturing on the object.
> This is the segment of code used to load the file:
>
> ---------------------------------
> ObjectFile f = new ObjectFile(flags,(float)(creaseAngle * Math.PI / 180.0));
> Scene s = null;
> try
> {
>  s = f.load(filename);
> }
> etc.
> ----------------------------------
>
> This is the standard code for texturing:
>
> ----------------------------------
> Appearance app = new Appearance();
> TextureLoader tex = new TextureLoader("java.gif", this);
> app.setTexture(tex.getTexture());
> TextureAttributes texAttr = new TextureAttributes();
> texAttr.setTextureMode(TextureAttributes.MODULATE);
> app.setTextureAttributes(texAttr);
> app.setMaterial(new Material(white, black, white, black, 1.0f));
> return app;
> ----------------------------------
>
> Can anyone tell me how I apply the appearance called "app"
> to the object, maybe the line of code to do it?
>
> Thanks for any help,
>
> Phelim.
>
> ===========================================================================
> 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".

===========================================================================
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