code-google-com / opencollada

Automatically exported from code.google.com/p/opencollada
0 stars 0 forks source link

COLLADAFW::Mesh remaps TEXCOORD semantic to UV functions #39

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. COLLADAFWMesh.h and .cpp remap TEXCOORD semantic to UVCoords().
2. Mesh class appears to support UV and not texture, and cannot support both.
3.

What is the expected output? What do you see instead?
In COLLADA, texture coordinates are not the same as UV coordinates. A mesh
can have both sets of semantics. Therefore the Mesh class should provide
storage and methods for both semantics. E.g.:

Mesh::getTexCoords() [rename current interface] should return data from
<input semantic="TEXCOORD">.

Mesh::getUVCoords() [reimplement] should return data from <input
semantic="UV"> and this is data that is rarely used (advanced applications
only).

Please use labels and text to provide additional information.
Also, each Mesh can have multiple sets of vertex attribute data. The Mesh
class currently supports only one of each semantic.

Original issue reported on code.google.com by Marcus.C...@gmail.com on 14 Dec 2009 at 11:29

GoogleCodeExporter commented 9 years ago
The code in this function is incorrect because texture coordinates cannot have
InputSemantic::UV in COLLADA:

    bool MeshLoader::loadTexCoordsSourceElement ( const InputShared& input )
    {
        bool retValue = true;

        // Get the semantic of the current input element.
        InputSemantic::Semantic semantic = input.getSemantic ();
        if ( semantic != InputSemantic::UV && semantic != InputSemantic::TEXCOORD )
        {
            std::cerr << "The current input element is not a UV / TEXCOORD element!"
<< std::endl;
            return false;
        }

Original comment by Marcus.C...@gmail.com on 15 Dec 2009 at 11:13

GoogleCodeExporter commented 9 years ago
This function is also wrong for the same reason.

    bool MeshLoader::loadSourceElement ( const InputShared& input )
    {
        bool retValue = false;

        // Get the semantic of the current input element.
        InputSemantic::Semantic semantic = input.getSemantic ();
        switch ( semantic )
        {
...
        case InputSemantic::UV:
        case InputSemantic::TEXCOORD:
            retValue = loadTexCoordsSourceElement ( input );
            break;
...
        }

Original comment by Marcus.C...@gmail.com on 15 Dec 2009 at 11:22

GoogleCodeExporter commented 9 years ago

Original comment by opencollada2@googlemail.com on 19 Jan 2011 at 2:27