#175523 - Scribe - Mon Dec 13, 2010 1:11 am
Hi guys,
I've just written for the most part an FBX to DS friendly CallList file converter, however, my normals are all a mess, I'm using a simple cube for my first test with normals that line up with a plane (so one component is always 1), I've confirmed that they are being converted to the v10 format correctly but I'm getting about half a face out of my entire cube showing, there's no issue if I turn my normals off, any ideas?
call list code:
I greatly appreciate any help.
Many thanks[/code]
I've just written for the most part an FBX to DS friendly CallList file converter, however, my normals are all a mess, I'm using a simple cube for my first test with normals that line up with a plane (so one component is always 1), I've confirmed that they are being converted to the v10 format correctly but I'm getting about half a face out of my entire cube showing, there's no issue if I turn my normals off, any ideas?
call list code:
Code: |
// Write Tex-Coord meshFile->Write( (UInt32)TEXTURE_PACK(floatToFixed164( vertex.GetAt( 0 ) ), floatToFixed164( vertex.GetAt( 1 ) )) ); // Write vertex meshFile->Write( (UInt32)VERTEX_PACK(floatToFixed3212( vertex.GetAt( 0 ) ), floatToFixed3212( vertex.GetAt( 1 ) )) ); meshFile->Write( (UInt32)VERTEX_PACK(floatToFixed3212( vertex.GetAt( 2 ) ), 0) ); // Write Normal meshFile->Write( (UInt32)NORMAL_PACK(floatToFixed1010( normal.GetAt( 0 ) ), floatToFixed1010( normal.GetAt( 1 ) ), floatToFixed1010( normal.GetAt( 2 ) )) ); // Write next command pack if( mesh->GetPolygonCount()*3 - i > 1 ) { meshFile->Write( (UInt32)FIFO_COMMAND_PACK( FIFO_TEX_COORD, FIFO_VERTEX16, FIFO_NORMAL, FIFO_NOP ) ); //.................. // Floating-point to fixed point 10-bit (10-bit fractional) convertion private: fbxShort1 floatToFixed1010( fbxDouble1 floatingPoint ) { const static fbxInteger1 factor = 1 << 9; if( floatingPoint > 0.998 ) { return (fbxShort1)0x1FF; } else { return static_cast<fbxShort1>(floatingPoint*factor); } } |
I greatly appreciate any help.
Many thanks[/code]