Yeah im totaly missing whats going wrong here .what if the attribute
buffer gets added i dnt know how to further help this function towards
victory .just not enough experience yet

EDIT:
another little stab at it...
heres a function txesmi has written for normal calculation
perhaps if the merged entity's normals gets recalculated with it?
i almost want to point out that perhaps the normals points to the unrotated/unscaled/unoffset'd mesh but im not sure
Code:
function true_fixnormals ( ENTITY *ent )
{
	D3DVERTEX *vb;
	short *tb;
	long *at;
	int i, ii;
	VECTOR vNormal, vOldNormal, v1, v2, v3;
	
	int tnum = ent_status ( ent, 4 );
	int vnum = ent_status ( ent, 1 );
	
	ent_buffers ( ent, 0, 0, &vb, &tb, &at );
	
	for ( i=0; i<vnum; i++ ) // reset normals
	{
		vb[i].nx = vb[i].ny = vb[i].nz = 0;
	}
	
	for ( i=0; i<tnum*3; i+=3 ) // compute normals
	{
		vec_set ( v1, vector ( vb[tb[i]].x, vb[tb[i]].z, vb[tb[i]].y ) ); // we can't operate with floats as vectors
		vec_set ( v2, vector ( vb[tb[i+1]].x, vb[tb[i+1]].z, vb[tb[i+1]].y ) );
		vec_set ( v3, vector ( vb[tb[i+2]].x, vb[tb[i+2]].z, vb[tb[i+2]].y ) );
		
		vec_cross ( vNormal, vec_diff ( NULL, v3, v1 ), vec_diff ( NULL, v2, v1 ) );
		vec_normalize ( vNormal, 1 );
		
		for ( ii=0; ii<3; ii++ ) // add the new normal to each vertex
		{
			vec_set ( vOldNormal, vector ( vb[tb[i+ii]].nx, vb[tb[i+ii]].nz, vb[tb[i+ii]].ny ) );
			vec_add ( vOldNormal, vNormal );
			vec_normalize ( vOldNormal, 1 );
			vb[tb[i+ii]].nx = vOldNormal.x;
			vb[tb[i+ii]].ny = vOldNormal.z;
			vb[tb[i+ii]].nz = vOldNormal.y;
		}
	}
}



Last edited by Wjbender; 06/02/12 15:41.

Compulsive compiler