Please support X3D files with color per vertex, and color per face

Discussion in 'Bug Reporting' started by ksims, May 31, 2013.

  1. ksims
    ksims New Member
    Your site says you support VRML with color per face, but I can't get that to work. My apps don't export VRML and I can't find any working example. There is also no good way to convert my convoluted object's vertex colors to textures. X3D was meant to supersede VRML anyway, so why not just support X3D with non-texture colors. Thanks!
  2. mkroeker
    mkroeker Well-Known Member
    Have you tried with a simple file, say a cube or tetrahedron ? X3D with vertex colors should be supported already, maybe
    it is something else in your files that causes a problem (number of triangles over - or close to - the 1 million limit, or file bigger
    than 64mb) ?
  3. ksims
    ksims New Member
    Yes I did try a simple X3D octahedron with vertex colors, and another with face colors, exported from Meshlab.
    They were both rendered all white.
    Would be nice if it were just something that could be fixed about the file, but Shapeways service claimed these are not supported, so I didn't keep working on it. An example known to work would be very helpful!
  4. mkroeker
    mkroeker Well-Known Member
    At least some variations of specifying colorPerVertex do work, I just tried with one of the generic X3D examples. Maybe it is related to the color node used - I seem to remember a few months back someone had a similar problem that turned out to be related to the use of ColorRGBA nodes instead of plain RGB colors.
    (Can you post or PM one of your examples ?)
    Last edited: May 31, 2013
  5. ksims
    ksims New Member
    Aha, I saw that thread but thought it only applied to VRML files. Indeed if I manually replace 'ColorRGBA' with 'Color' and strip out every 4th color value (the Alpha channels) then it renders in color. So at least there is a way... You'd think the alpha channel should just be ignored, rather than completely ignoring all colors in the case of RGBA. Of course I haven't actaully tried printing one of these yet, but at least it renders in color. Thanks!

    In case this is helpful to others, here are the contents of an example octahedron X3D file with vertex colors:

    <?xml version="1.0" encoding="UTF-8"?>
    <X3D profile="Immersive" version="3.1">
    <IndexedFaceSet coordIndex="0 1 2 -1 3 1 0 -1 2 4 0 -1 0 4 3 -1 5 2 1 -1 3 5 1 -1 5 4 2 -1 3 4 5 -1" solid="false">
    <Coordinate point="-0.005 -0.005 -0.0125 -0.005 -0.0125 -0.005 -0.0125 -0.005 -0.005 0.0025 -0.005 -0.005 -0.005 0.0025 -0.005 -0.005 -0.005 0.0025"/>
    <Color color="1 1 0 1 0 0 0 1 0 0 0 1 0 1 1 1 0 1"/>
  6. AlanHudson
    AlanHudson Shapeways Employee Dev Team
    Thanks for the report about missing ColorRGBA support. We've coded up a fix and it's in testing. I would expect it will be available for the June 12 release. The alpha values are just ignored.