Hi,
the normal of a triangle can be computed by the cross product of two of its edges. I mean, on an ABC triangle, AB x AC. The result may need to be normalized.

As a unasked tip, It is always good to not to repeat the same operation. It is faster to get a pointer to the D3DVERTEX struct for each vertex.

Code
ent_buffers(ent_level, 0, 0, &vbuffer ,&ibuffer, NULL) ;

short *ibT = ibuffer + (int)hit.triangle * 3;

D3DVERTEX *vbT = vbuffer + *ibT;
v1.x = vbT->x; 
v1.y = vbT->z;
v1.z = vbT->y:

vbT = vbuffer + *(++ibT);
v2.x = vbT->x; 
v2.y = vbT->z;
v2.z = vbT->y:

vbT = vbuffer + *(++ibT);
v3.x = vbT->x; 
v3.y = vbT->z;
v3.z = vbT->y:

vec_diff(e1, v2, v1);
vec_diff(e2, v3, v1);
vec_cross(n0, e1, e2);
vec_normalize(n0, 1);



Salud!