R: [Plib-users] 3ds file load error
Brought to you by:
sjbaker
From: Paolo L. <p.l...@ci...> - 2004-04-20 09:03:26
|
Sharon, IIRC there's a limit of 65536 (unsigned short) vertices per ssg leaf, so the error seems due to an overflow into the ssgVtxArray structure (confirmed by the diagnostic "as file became more complex"). Greetings - Paolo -----Messaggio originale----- Da: pli...@li... [mailto:pli...@li...] Per conto di Sharon Inviato: marted=EC 20 aprile 2004 8.41 A: pli...@li... Oggetto: [Plib-users] 3ds file load error 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:=20 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 =3D *( 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 =3D *( indices -> get ( vv1 ) ) ; *v2 =3D *( indices -> get ( vv2 ) ) ; *v3 =3D *( indices -> get ( vv3 ) ) ; } After I upgraded plib to 1.8.3, I got the exception in " tlist [ tnum*3+ 1 ] =3D v2 ;" of this method in ssgOptimiser.cxx: short OptVertexList::add ( short v1, short v2, short v3 ) { if ( v1 =3D=3D v2 || v2 =3D=3D v3 || v3 =3D=3D v1 ) /* Toss degenerate = triangles */ { vlist [ v1 ] -> dent () ; /* Un-reference their vertices */ vlist [ v2 ] -> dent () ; vlist [ v3 ] -> dent () ; return -1 ; } =20 tlist [ tnum*3+ 0 ] =3D v1 ; tlist [ tnum*3+ 1 ] =3D v2 ; tlist [ tnum*3+ 2 ] =3D v3 ; =20 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=A2 |