[Plib-users] 3ds file load error
Brought to you by:
sjbaker
From: Sharon <sha...@ya...> - 2004-04-20 07:41:18
|
Hi, Steve, I created the whole landscape(for a driving environment) in 3d max and exported it to a .3ds file, then I use ssgLoad3ds to load this file. The whole landscape is a NURBS surface. It's working fine until tonight after I added some vertexes to create a hill. I got this error: unhandled error in 0xC0000005: Access Violation. I set the breakpoint and debugged the program. When I use plib 1.6, the error is in "*v3 = *( indices -> get ( vv3 ) ) ;" of this method in ssgVexArray.cxx: void ssgVtxArray::getTriangle ( int n, short *v1, short *v2, short *v3 ) { short vv1, vv2, vv3 ; ssgVtxTable::getTriangle ( n, &vv1, &vv2, &vv3 ) ; *v1 = *( indices -> get ( vv1 ) ) ; *v2 = *( indices -> get ( vv2 ) ) ; *v3 = *( indices -> get ( vv3 ) ) ; } After I upgraded plib to 1.8.3, I got the exception in " tlist [ tnum*3+ 1 ] = v2 ;" of this method in ssgOptimiser.cxx: short OptVertexList::add ( short v1, short v2, short v3 ) { if ( v1 == v2 || v2 == v3 || v3 == v1 ) /* Toss degenerate triangles */ { vlist [ v1 ] -> dent () ; /* Un-reference their vertices */ vlist [ v2 ] -> dent () ; vlist [ v3 ] -> dent () ; return -1 ; } tlist [ tnum*3+ 0 ] = v1 ; tlist [ tnum*3+ 1 ] = v2 ; tlist [ tnum*3+ 2 ] = v3 ; return tnum++ ; } The above error only happened when my 3ds file became more complex. I double if your 3ds parser could parse the very complex NURBS surfaces. I rendered my landscape in 3d max and the render result is correct. Looking forward to your help. Thanks. Sharon --------------------------------- Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢ |