thanks guido,
all of the collada files i've seen don't actually have colors per face,
but simply have a <diffuse><color> tag in the face's material (which isn't
imported by meshlab's collada input function). looking through the code it
seemed like the io function was designed to read in colors from <triangle>
tags but i wasn't sure what syntax it was expecting. what do facenormals
have to do with face colors?
what's the best way to import these colors to faces?
i wrote a function to find the rgb colors for a particular material, and
another one to try and another one based on WedgeColorAttribute that was
called from LoadTriangularMesh for every triangle, if it had a color defind
in its material. it tried to do this:
m.face[meshfaceind].C() = vcg::Color4b(list.at(0).toFloat(),list.at
(0).toFloat(),list.at(0).toFloat(),list.at(0).toFloat());
but it didn't seem to work...
will HasPerWedgeColor only return true if every face has a color (because
some, not all, faces tend to have colors)?
thanks
On Fri, Mar 14, 2008 at 3:34 AM, <Gui...@is...> wrote:
> Hi Imran,
> first of all sorry for the delay with which I replay to all your mails
> but the deadline to our paper will be on April and I have to hardly work
> on it.
> Are you sure that you sure that the mesh would have the color per face
> attribute enabled?!? to test it add before you read the color per face
> from a collada file an if statement that test bitmask passed to the dae
> importing filter with the vcg::tri::io::Mask::IOM_FACENORMAL value (i.e.
> if (mask & vcg::tri::Mask::IOM_FACENORMAL)).
>
> Guido
>
>
> On 3/12/2008, "Imran Akbar" <im...@os...> wrote:
>
> >Guido,
> > do you know what the correct syntax is to allow meshlab to import a
> >face's colors? these triangles originally had texcoords that mapped to a
> >non-existant texture, as there were only colors defined in its material
> ><diffuse> tag. when i change texcoord to color and remove the offsets
> >meshlab crashes... what kind of syntax is the importer in import_dae.h
> >expecting?
> >
> ><triangles material="material0" count="2">
> > <input semantic="VERTEX" source="#mesh1-geometry-vertex"
> >offset="0"/>
> > <input semantic="NORMAL" source="#mesh1-geometry-normal"
> >offset="1"/>
> > <input semantic="COLOR" source="#material0-effect"
> set="0"/>
> > <p>0 0 1 0 2 0 1 0 0 0 3 0 </p>
> ></triangles>
> >
> >thanks,
> >imran
> >
> >
>
|