[X3D-Public] Multiple Materials for Geometry (IndexedFaceSet)

JOHN COADY johncoady at shaw.ca
Tue Jan 4 18:04:11 PST 2011


Does anyone from the web3d community have any ideas on how best to handle this issue when converting from blender to X3D. Blender supports multiple materials per object whereas X3D only supports a single material per shape in an appearance node. For example, in blender if you have a cube shaped object, you can assign a different material to each of the 6 faces of the cube. When exporting this object from blender into X3D the object is converted into a shape with an IndexedFaceSet and an appearance node with a single material. Only one of the 6 materials from the blender cube shaped object can be assigned to the indexedFaceSet cubed shaped object in X3D. The blender developer is suggesting to break up the cube shaped object from blender and creating 6 separate IndexedFaceSet objects in X3D, one for each face of the cube, so that he can assign a unique material to each of the 6 faces. Is this a good idea? He wants to do the same thing if there are multiple textures on the object in blender. The other way to handle it is to use the color field of the indexed face set and assign a color to each of the faces in X3D from the diffuse color of the material in blender for that face.

----- Original Message -----
From: Dave A <dave at realmofconcepts.com>
Date: Tuesday, January 4, 2011 5:28 pm
Subject: Re: [X3D-Public] Multiple Materials for Geometry (IndexedFaceSet)
To: Campbell Barton <ideasman42 at gmail.com>, X3D-Public at web3d.org

> I think you need to break the mesh into pieces (then put them in 
> a Group) because you can have only one Appearance per mesh.
> 
> "Campbell Barton" <ideasman42 at gmail.com> wrote:
> 
> >Hi, I'm currently making some updates to blender 2.5'x X3D exporter,
> >since we have a diligent user reporting all sorts of bugs.
> >
> >One problem I've hit is that it seems there is no way to have
> >different materials for one mesh.
> >
> >There are some ways that have been suggested but I find both
> >unsatisfactory.
> >
> >1) Set colorPerVertex="false", then define color per face.
> >This is no good because you may have different specular, diffuse
> >values per material (not just color)
> >
> >2) Use MultiTexture?, This was suggested but from what I can 
> tell its
> >only for layering textures, not applying different textures to
> >different parts of the mesh.
> >
> >The things Id like to support are:
> >- Different images on the same mesh.
> >- Different material's on the same mesh.
> >
> >From what I can tell there is no way to do this so as a last resort
> >the exporter could split the object's materials into multiple 
> objects,>which is not ideal but I cant see an alternative.
> >
> >Am I missing something?.
> >
> >-- 
> >- Campbell
> >
> >_______________________________________________
> >X3D-Public mailing list
> >X3D-Public at web3d.org
> >http://web3d.org/mailman/listinfo/x3d-public_web3d.org
> 
> -- 
> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
> 
> _______________________________________________
> X3D-Public mailing list
> X3D-Public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20110104/3442f57b/attachment.html>


More information about the X3D-Public mailing list