The ObjectFile loader will return a Scene object. This object has a method called getNamedObjects() that you can use to get to the individual Shape3Ds that make up the model. You can then use setAppearance() on a Shape3D to change the appearance of that part to whatever you want. -Paul > From: GAISSA <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: RE: [JAVA3D] texturing in .obj file in run time > Date: Wed, 3 Jan 2001 09:56:50 +0900 > MIME-Version: 1.0 > Content-Transfer-Encoding: 8bit > X-MIME-Autoconverted: from quoted-printable to 8bit by gromit.eng.sun.com id QAA06860 > > Thank you. but, > I want change appearance of shape in run time. > when i use obj, and mtl(include texture,material infomation) file, > The problem is.. > if I want change only texture of obj on run, reload other .obj and .mtl > file. > (delete child, and add other child) > > please help me. > > now, i use Load3DS. but it is include same problem. > > > > > -----Original Message----- > From: Paul Pantera [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 03, 2001 5:59 AM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [JAVA3D] texturing in .obj file > > > > Texturing is supported by the .obj file format and the loader. You > don't need to add code to your program to support textures. A texture > is simply a material property applied to parts of the model. The .obj > file format is described in the ObjectFile javadoc (separate > download). You can figure it out by reading that, or you can look at > the demo in the SDK: > > cd demo/java3d/ObjLoad > java ObjLoad ../geometry/minimart.obj > > Look at minimart.obj to see how it's done. > > The code of ObjLoad and ObjectFile is included in utils-src.jar > (included in the sdk). > > -Paul > > > MIME-Version: 1.0 > > Date: Thu, 28 Dec 2000 19:25:06 +0900 > > From: �̽��� <[EMAIL PROTECTED]> > > Subject: [JAVA3D] texturing in .obj file > > To: [EMAIL PROTECTED] > > > > Please help me. > > how texturing in obj files. > > > > Scene s = null; > > s = f.load("c:/3ds_object/body.obj"); > > Transformgroup objScale = new TransformGroup(); > > objScale.addChild(s.getSceneGroup()); > > > > Appearance app = new Appearance(); > > Texture tex = new TextureLoader("front.jpg", this).getTexture(); > > app.setTexture(tex); > > TextureAttributes texAttr = new TextureAttributes(); > > texAttr.setTextureMode(TextureAttributes.MODULATE); > > app.setTextureAttributes(texAttr); > > > > BranchGroup b1 = s.getSceneGroup(); > > Shape3D shape1 = (Shape3D) b1.getChild(0); > > GeometryArray g1 = (GeometryArray) shape1.getGeometry(); > > shape1.setGeometry(g1); > > shape1.setAppearance(app); > > > > I think must figure out about TEXTURE_COORDS > > help me. > > > > > ======================================================================== > === > > 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".
