I'm not an expert, but I think you could add your app object to the scene's
Shape3D object.
I think the scene object has a method to get the Shape3D (maybe
getShape3D() or something like that).
> ----------
> From: PK[SMTP:[EMAIL PROTECTED]]
> Reply To: Discussion list for Java 3D API
> Sent: Wednesday, March 08, 2000 12:05 PM
> To: [EMAIL PROTECTED]
> Subject: [JAVA3D] Texturing Object File
>
> Hi All,
>
> I've loaded an Object file(.obj) and I now want to texture it with
> a .jpg file. Can anyone help me with this?
>
> Here's the important bit of my code for loading the file:
>
> Scene s = null;
> s = f.load(filename); //filename is the name of the file, cube.obj for
> ex.
> objTrans.addChild(s.getSceneGroup()); //objTrans is the TransfromGroup
>
> Here's the code for texturing..
>
> Appearance app = new Appearance();
> TextureLoader tex = new TextureLoader("Image.jpg", 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));
>
>
> Both bits of code work OK independantly, I just don't know how to
> combine them.
>
> I hope someone can help me,
>
> Thanks,
>
> 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".