# NORMALS wrong place in Collada?

This topic is 2266 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Sometimes when Maya exports models, it exports them the normals in a different location.

Sometimes it puts the normals under the <vertices>

<vertices id="objgoblin_1-VERTEX">
<input semantic="POSITION" source="#objgoblin_1-POSITION"/>
<input semantic="NORMAL" source="#objgoblin_1-Normal0"/>
</vertices>
<triangles count="7820" material="_3_FBXASC045_Default">
<input semantic="VERTEX" offset="0" source="#objgoblin_1-VERTEX"/>
<input semantic="TEXCOORD" offset="1" set="0" source="#objgoblin_1-UV0"/>
</triangles>

When typically it exports them like this

<vertices id="pCylinder1-VERTEX">
<input semantic="POSITION" source="#pCylinder1-POSITION"/>
</vertices>
<triangles count="120" material="lambert2">
<input semantic="VERTEX" offset="0" source="#pCylinder1-VERTEX"/>
<input semantic="NORMAL" offset="1" source="#pCylinder1-Normal0"/>
</triangles>

What's the difference and why does it export them at two different locations? I would prefer it to always have it in the triangles node. Because I need the offset. Edited by mgoss

##### Share on other sites
I don't think you really need an offset. The inputs are always in the same order as in the file. Just read the inputs in the same order and increment the offset by 1 in your code.

For example:

int offset = 0 For every node in triangles if semantic = "VERTEX" Find vertices node, for every node in Vertices ReadInputNode(offset++) else ReadInputNode(offset++); And then in the ReadInputNode function, you would have something like this: ReadInputNode(int offset) { pNode->mOffset = offset // Read whatever you want from the input node }

It's not a nice solution, but the COLLADA format sucks. Its exporters suck more.

You can always use the Assimp library to import COLLADA files, makes life much easier.

Edit: Don't mind the gazillion edits, just trying to work out the indents. I spent way too much time on them. They still look like crap. Excuse me while i go search for a life. Edited by Waaayoff

1. 1
2. 2
3. 3
4. 4
Rutin
13
5. 5

• 12
• 15
• 9
• 14
• 10
• ### Forum Statistics

• Total Topics
632655
• Total Posts
3007675
• ### Who's Online (See full list)

There are no registered users currently online

×