• Advertisement

# 3ds max export flipped normals problem

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

If you intended to correct an error in the post then please contact us.

## Recommended Posts

Hi! I've been updating my 3ds max geometry exporter for the past couple of weeks and I realized I have a problem with exporting normals. For example, I exported a car mesh I made that is composed of several sub-meshes (wheels, chassis, seats, etc.). While some of those sub-meshes rendered just fine, others had their normals flipped. When I flipped the normals in Max, those sub-meshes would also render correctly. The problem is that the mesh as a whole renders correctly in Max, so I'm assuming it's an export problem. Here's what my normal export code looks like:
if (mesh->GetNumberOfNormals() > 0 &&
mesh->GetNormal(face->norm[j], vector))
{
outputVertex.normal.x = vector.x;
outputVertex.normal.y = vector.y;
outputVertex.normal.z = vector.z;
}


where face is the current face and j is a loop variable that goes from 0 to 2. I looked at the source code of the ogre3d max exporter and also the collada max exporter. Ogre 3D manually transforms the normals from object space to world space, but the MAX SDK I'm using seems to be doing this by itself (you actually have to specify a parameter to get object-space-normals). Collada uses a different method to obtain the normals, but when I use that method myself, it seems like it just gives me object space normals. Anyone know how to fix that or what could be the problem? Thanks a bunch in advance! EDIT: I found another clue: If I attach all the sub-meshes together, then all normals are flipped and I can simply flip them back to get correct normals. However, I'd rather keep my meshes separate in 3ds max.

Advertisement
Anyone?

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement
• ### Popular Tags

• Advertisement
• ### Popular Now

• 11
• 16
• 11
• 13
• 11
• Advertisement