Menu

#40 u3d: colors and textures

open
nobody
5
2014-08-19
2008-03-22
No

Now Meshlab 1.1.1 can properly render .ply files generated by Mathematica. Also it can half properly render unzipped Google Earth Collada files (download kmz and unzip it; usually it contains kml, dae and a bunch of jpg files).

However export to u3d is grayscale and in case of dae one cannot see all nice details from jpg.

Since u3d is currently the only format which could be embedded in pdf it would be nice to have the best possible output

Discussion

  • Paolo Cignoni

    Paolo Cignoni - 2008-03-28

    Logged In: YES
    user_id=258998
    Originator: NO

    On some OS the u3d exporter has problems with textures that are not in the same exact dir of the master file.
    Try to change the dae file so that all the textures are in the same dir of the dae and (hopefully) should work

    For the per vertex color there are problem with the AcrobatReader renderer (it seems not very consistent with the specs).
    We are working on it.

    p.

     
  • Henrik Carlqvist

    I have also had problems converting a 3ds file to a u3d file with textures using the following command:

    meshlabserver -i file.3ds -o file.u3d -om wt

    IDTFConverter bailed out as the generated idtf file was broken. I was using meshlab 1.3.0a. The following patch fixed my problem:

    -8<----------------------------------------------------------------
    --- meshlab-130a.org/vcglib/wrap/io_trimesh/export_idtf.h 2011-01-25 08:53:42.000000000 +0100
    +++ meshlab-130a.fixed/vcglib/wrap/io_trimesh/export_idtf.h 2011-04-08 12:58:04.000000000 +0200
    @@ -169,7 +169,7 @@
    //QString moutfile = QString("C:/Users/Guido/AppData/Local/Temp/duckCM.tga");

                QFile file(qPrintable(outfile));
    
    • file.setPermissions(QFile::WriteOther);
    • file.setPermissions(QFile::WriteOwner | QFile::ReadOwner);
      file.open(QIODevice::WriteOnly);
      QString err = file.errorString();
      //bool val = file.failbit;
      @@ -359,25 +359,20 @@
      idtf.write(2,"ATTRIBUTE_USE_VERTEX_COLOR \"" + vertcol + "\"");
      idtf.write(2,"SHADER_MATERIAL_NAME \"Mat01\"");

    -
    - int texcount = 0;
    - if (mask & vcg::tri::io::Mask::IOM_WEDGTEXCOORD)
    - texcount = m.textures.size();
    -
    -
    - idtf.write(2,"SHADER_ACTIVE_TEXTURE_COUNT " + TextUtility::nmbToStr(texcount));
    if (mask & vcg::tri::io::Mask::IOM_WEDGTEXCOORD)
    {
    + idtf.write(2,"SHADER_ACTIVE_TEXTURE_COUNT 1");
    idtf.write(2,"SHADER_TEXTURE_LAYER_LIST {");
    idtf.write(3,"TEXTURE_LAYER 0 {");
    idtf.write(4,"TEXTURE_NAME \"Texture" + TextUtility::nmbToStr(ii) +"\"");
    idtf.write(3,"}");
    idtf.write(2,"}");
    }
    + else
    + idtf.write(2,"SHADER_ACTIVE_TEXTURE_COUNT 0");

    -
    + idtf.write(1,"}");
    }
    - idtf.write(1,"}");
    idtf.write(0,"}");
    idtf.write(0,"");
    }
    @@ -653,4 +648,4 @@
    }
    }

    -#endif
    \ No newline at end of file
    +#endif
    -8<----------------------------------------------------------------

     
  • Henrik Carlqvist

    Sorry about the broken lines in the patch in my previous comment. Do you have anywhere I can post the patch?

     

Log in to post a comment.