Results 1 to 5 of 5

Thread: Different numbe of vertex and normals

  1. #1
    Junior Member
    Join Date
    Nov 2007
    Location
    Lima Perú
    Posts
    10

    Different numbe of vertex and normals

    Hello!

    I am just trying to load the COLLADA files. I cretaed a document with blender with two cameras, two meshes and one light. When I'm parsing the meshes I find that the number of vertex is 2982 with accesor count 994, but the number of normals is 3072 with accesos count 1024. How are they handle? I want to load this models with openGL. I'm using DOM.

    One more question about Collada DOM. If I create an extension to support scripts, will this extra tags be erased in an open/save operation with COLLADA DOM? and what would happen with FCollada?

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    Collada uses what I call "non-unified indices". Here's an excerpt from another thread where I try to explain:
    Quote Originally Posted by sthomas
    The key thing that may be confusing is that Collada allows different indices per stream (I call them "non-unified indices"). That is, a single logical "index" can refer to (e.g.) the 10th position and the 3rd normal. Graphics APIs like OpenGL and Direct3D only support unified indices, where each index is a single value specifying where to look in both the position and normal streams. Non-unified indices are more flexible and allow a more compact data representation. For example, using non-unified indices, a cube can be described with 8 positions and 6 normals, but with unified indices you need 24 positions and 24 normals.

    Dealing with non-unified indices is one of the trickier aspects of writing a Collada importer, since most Collada exporters write data using non-unified indices, and most graphics APIs don't support them. You need to transform the data to unified index form. This code is tricky to write, but fortunately it's already been done for you. The confusingly-named "deindexer" conditioner in the Collada Refinery converts a Collada document to unified index form.
    Quote Originally Posted by RaulHuertas
    If I create an extension to support scripts, will this extra tags be erased in an open/save operation with COLLADA DOM? and what would happen with FCollada?
    The DOM will preserve the <extra> elements. I'm not sure what FCollada does.

    Steve

  3. #3
    Junior Member
    Join Date
    Nov 2007
    Location
    Lima Perú
    Posts
    10

    Thanks!

    Thanks buddy.

  4. #4
    Junior Member
    Join Date
    Nov 2007
    Location
    Lima Perú
    Posts
    10

    quick question

    The number of vertex is always bigger or equal than the number of any other attribute stream right?

  5. #5
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    That isn't necessarily the case, no.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •