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".