Is (vertex_count=face_count*3) -necessary ?

Help
2013-08-11
2013-09-06
  • despicableME

    despicableME - 2013-08-11

    Hi,

    I'm trying to use assimp (via .net wrapper) to:
    1. import stl file (binary)
    2. generate vertex normals
    3. export to obj

    Since assimp viewer insists on vertex_count=face_count3 - I've tried to "fool" it by indexing stl in my program and then importing it as obj into viewer.
    My indices count and indices count for Maya 2011 are the same but I've got few extra in assimp viewer.
    Then, when I try to export model I'm getting vertex_count=face_count
    3 even if vertex count is about 60% of face count..

    So, my question is: can I somehow take advantage of indexing in assimp and have reasonable vertex count (without doubles)?

     
  • Thomas Ziegenhagen

    Do you employ aiProcess_JoinIdenticalVertices? The vertec_count == face_count x3 is a necessary prerequisite for some post processing steps, but once those are done, most other applications profit from indexed primitives. And JoinIdenticalVertices does exactly that.

    And btw: AssimpView does not insist on non-indexed primitives. I worry that you might have mixed something there.

     
  • despicableME

    despicableME - 2013-08-28

    First line in:
    bool GenVertexNormalsProcess::GenMeshVertexNormals (aiMesh* pMesh, unsigned int meshIndex)

    is:
    if (NULL != pMesh->mNormals)
    return false;

    It seems that it does insist! :)
    So in case of binary STL (by file format only surface normals are supported) - importer will read normals from file and then when you try to generate vertex normals above will happen. After removing above condition I get it working.

    Sorry for late response, I've explained it here: http://code.google.com/p/assimp-net/issues/detail?id=16&can=1

     
  • Thomas Ziegenhagen

    Erm... what? What does the existence of normals in a mesh have in common with the number of vertices? Of course the "Generate Normals" does not do anything if the mesh already has normals. And in a completely unrelated topic: of course there won't be any double vertices when you employ the JoinIdenticalVertices post processing step. Every vertex you have in a mesh will have something unique to it, be it something obvious like a different position or a different normal, or something less visible like a different vertex colour alpha value, or a tangent.

    Oh, but it might look like completely identical vertices after export if you imported/generated some vertex data that the target export file format doesn't support. For example: tangents / bitangents. In that case the JoinIdenticalVertices was forced to keep the vertices separate, but the exporter discarded the separating data and thus some vertices come out identical in the exported file. So avoid generating this data, or remove offending data with the RemoveComponent post processing step.

     

Log in to post a comment.