I'm a victim of the reply-to field...
Josh Vanderhoof wrote: > > [EMAIL PROTECTED] writes: > > > I just tryed the "new" calculate_bounds3 and calculate_bounds2, but it does > > not solve the floating overflow/invalid problems on my VMS-box. > > Sorry. I assumed it was the same bug because it fixed a seg fault on > the same test on Linux. > > I think the problem is that projection skips clipped vertices but > window mapping doesn't. You can "fix" it by initializing vProj to 0.0 > for clipped vertices in clip_tmp.h/cliptest_points4(). To fix it > correctly, either the cull mask has to mask off clipped vertices, or > we need to handle the window mapping in a separate function that does > check the clip mask. I agree that this is a problem. The strictly correct behaviour would be to process neither the clipped nor the culled vertices - I felt when writing the code that producing another cull style array would be more effort than we gained from skipping the clipped-but-not-culled vertices. I didn't want a new function for similar reasons - the cost of two tests, and also the requirement for more assembly to be written. I still feel this way, although without any timing evidence to back up my position. I would rather ensure the values were valid but ignored, and do so with minimal effort. The easiest fix, then, is to initialize the clip and win arrays in the vb at the time the vb is created. Assuming everything works correctly, all other operations will only produce valid FP values, any invalid ones must have been left over from (non) initialization of the array. So, please try this patch: diff -c -r3.7 vb.c *** vb.c 1999/02/25 14:12:32 3.7 --- vb.c 1999/03/07 13:29:33 *************** *** 87,92 **** --- 87,96 ---- gl_init_vector4f( &vb->Eye, 2, VEC_WRITABLE, 0 ); gl_init_vector4f( &vb->Clip, 2, VEC_WRITABLE, 0 ); gl_init_vector4f( &vb->Win, 2, VEC_WRITABLE, 0 ); + + MEMSET( vb->Clip.data, 0, VB_SIZE * sizeof(GLfloat) * 4 ); + MEMSET( vb->Win.data, 0, VB_SIZE * sizeof(GLfloat) * 4 ); + gl_init_vector4ub( &vb->BColor, VEC_WRITABLE, 0 ); gl_init_vector1ui( &vb->BIndex, VEC_WRITABLE, 0 );