If you ever have imported FBX file with assimp - you'll notice that the model itself isn't imported correctly. If it turns out to be a spagetti mesh then the data wasn't loaded correctly. If the model's rotation was facing towards -Y axis where in 3DS Max or whatever 3D modeling tool you used is facing towards the +Z Up Axis or +Z Axis depending on modeling program again.
I created a very simple white wall with wood floor trim - i deleted the remaining unnecessary polygons. Upon importing the model to ASSIMP Scene you'll notice aiProcess_ declarations. The aiProcess declarations I used is as:
unsigned int processFlags =
aiProcess_CalcTangentSpace | // calculate tangents and bitangents if possible
aiProcess_JoinIdenticalVertices | // join identical vertices/ optimize indexing
//aiProcess_ValidateDataStructure | // perform a full validation of the loader's output
aiProcess_Triangulate | // Ensure all verticies are triangulated (each 3 vertices are triangle)
aiProcess_ConvertToLeftHanded | // convert everything to D3D left handed space (by default right-handed, for OpenGL)
aiProcess_SortByPType | // ?
aiProcess_ImproveCacheLocality | // improve the cache locality of the output vertices
aiProcess_RemoveRedundantMaterials | // remove redundant materials
aiProcess_FindDegenerates | // remove degenerated polygons from the import
aiProcess_FindInvalidData | // detect invalid model data, such as invalid normal vectors
aiProcess_GenUVCoords | // convert spherical, cylindrical, box and planar mapping to proper UVs
aiProcess_TransformUVCoords | // preprocess UV transformations (scaling, translation ...)
aiProcess_FindInstances | // search for instanced meshes and remove them by references to one master
aiProcess_LimitBoneWeights | // limit bone weights to 4 per vertex
aiProcess_OptimizeMeshes | // join small meshes, if possible;
aiProcess_PreTransformVertices | //-- fixes the transformation issue.
aiProcess_SplitByBoneCount | // split meshes with too many bones. Necessary for our (limited) hardware skinning shader
0;
You'll notice the aiProcess_PreTransformVerticies that right there did the fix for me. Inside your modeller program if you're using Units of Feet - just know that the model will be imported large because it's using the 3D Modelling's units set up. I set my to export at 1 unit = 1 inch and unit's conversion to be inch 1.0 scale.
Here's a pretty snap shot taking from the app.
[attachment=28608:ScreenCaptured_nossao12079246.jpg]
Pretty nice wall eh? I can't model a female character worth a damn though but maybe I'll get there sooner or later. My female characters turn out to be creatures and somehow very not attractive - their faces look sinister and evil - don't know why that is. Any who - continuing on...
If you do get spaghetti meshes - it's mostly because of the indices. Conversion from openGL to DirectX isn't my best - so most of ASSIMP tutorials are in openGL including the skeletal animation which I still yet have to convert to DX understanding.
I didn't really know where to post this half tutorial - so I posted it in coding horrors because sometimes coding can give nightmares. Oh forget the whole file format of the snap shot Screen-nossao - the file is generated with the resulting salt and a random seed of the time date kind of thing. SSAO is disabled for now until I get it working.
At first I cringed at using ASSIMP but it's beneficial in many ways - regardless how bulky the dll file is. If you're ASSImp (which is a funny name - I keep on thinking of the Doom's Imps.) - and run into either spaghetti meshes or the model is transforming on the not right axis - then would be a good read.