doble post! xP

i gived a try to this problem and here is the result:

Code:
#include <acknex.h>
#include <default.c>

D3DVERTEX *vbuff0;
short *tbuff;

VECTOR vtemp;

TEXT* debug_txt =	
{  pos_x = 10;	  pos_y = 10;	  strings = 5;		font="courier#18";		flags = SHOW;	}


function show_normals ( ENTITY *ent )
{
	D3DVERTEX *vb;
	int vnum = ent_status ( ent, 0 );
	int i;
	
	ent_buffers ( ent, 0, 0, &vb, NULL, NULL );
	
	for ( i=0; i<vnum; i++ )
	{
		vec_set ( vtemp, vector ( vb[i].nx, vb[i].nz, vb[i].ny ) );
		vec_scale ( vtemp, 10 );
		vec_add ( vtemp, vector ( vb[i].x, vb[i].z, vb[i].y ) );
		
		draw_line3d ( vector ( vb[i].x, vb[i].z, vb[i].y ), COLOR_WHITE, 0 );
		draw_line3d ( vector ( vb[i].x, vb[i].z, vb[i].y ), COLOR_WHITE, 100 );
		draw_line3d ( vtemp, COLOR_RED, 100 );
		draw_line3d ( vtemp, COLOR_RED, 0 );
	}
}

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;
		}
	}
}

void main()
{
	int i=0;
	
	random_seed ( 0 );
	
	wait(1);
	level_load(NULL);
	wait(1);
	
	ENTITY* test = ent_create("ball.mdl", nullvector, NULL);
	camera.x = -300;
	camera.z = 300;
	camera.tilt = -45;
	
	while ( !key_space )
	{
		draw_text ( "Press space to continue...", 10, 10, COLOR_WHITE );
		show_normals ( test );
		wait(1);
	}
	
	ent_buffers ( test, 0,0, &vbuff0, NULL, NULL );
	
	for(i=0; i<ent_status(test,0); i++)		{	vbuff0[i].y += random(10)-5;	vbuff0[i].x += random(10)-5;	vbuff0[i].z += random(10)-5;	}
	true_fixnormals ( test );
	
	while ( 1 )
	{
		show_normals ( test );
		wait(1);
	}
}



It looks that works good but can't be sure. It really needs more precise computations than vec operations with those unit vectors...

Salud!