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

JOHN COADY johncoady at shaw.ca
Wed Jan 5 21:05:18 PST 2011


I picked up the fix and Exported to X3D from blender a 3D model of a pair of dice with multiple materials per object. You can see the X3D result as demo27 in this 3D gallery.

http://dl.dropbox.com/u/5095342/Xj3DApplet/rc1_pack200/3DGallery.html



----- Original Message -----
From: Dave A <dave at realmofconcepts.com>
Date: Tuesday, January 4, 2011 9:24 pm
Subject: Re: [X3D-Public] Multiple Materials for Geometry (IndexedFaceSet)
To: JOHN COADY <johncoady at shaw.ca>
Cc: x3d-public at web3d.org

> As he said, and I said, yes, break the mesh up. One Appearance 
> per mesh 
> (IFS) is all you get. So break it up by material/texture (in 
> effect, 
> Appearance), and then Group the parts is your best bet. Doing 
> that 
> per-vertex color thing is more work than it's worth for blandly-
> simple 
> objects.
> And note that if there are light maps, bump maps, etc. 
> (MultiTexture) 
> you need to account for those as well. I would sort all polygons 
> sharing 
> the same Appearance into the SAME (sub)mesh, rather than 
> creating 
> separate polygons, where ever possible.
> 
> Dave A.
> 
> On 1/4/2011 6:04 PM, JOHN COADY wrote:
> > 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/20110105/017a174a/attachment.html>


More information about the X3D-Public mailing list