Finally! Im back. Damn the real-world for interferig in my lite-c lifestyle!
Sivan: Ypu, figured that one out from hitting the Microsoft.net web.
Here is MY version that doesnt need d3d9/h included.
#define PRAGMA_API D3DXComputeNormals;D3DX9_30!D3DXComputeNormals
void __stdcall D3DXComputeNormals(void* pMesh, DWORD *pAdjacency);
void ent_normals(ENTITY* ent)
{ void* mesh_ptr; D3DXComputeNormals(mesh_ptr=ent_getmesh(ent,0,0), 0);
ent_setmesh(ent, mesh_ptr, 0, 0); }
Its a little dirty, but it does the job... well ...only HALF the job, as you will see by reading my reply to txesmi.
Wjbender: Precicely my problem. I put ent_fixnormals in there, even though
it doesnt work, in the hopes I was just using it badly. It resetting the
vertices just seems plain wrong. But I was hoping I was just applying it badly.
Going for a discrete algorithm is the way I would LIKE to go, but I just
havent been able to google anything that gives me the 'basics' of how to construct
said algorithm... But, see my reply to txesmi, he's got the answer!
txesmi: (post#1): AHHH! My friend, my hero, you LEGEND! That is precicely the 'golden nugget'
of information I was looking for! I understand about the averaging and can figure that out,
but I dont understand the need or the clockwise valuations. Do you know why?
I will aim for that, but if it gets ugly, I will try it without checking first.
txesmi: (post#2): I havent tried your code yet, so I will leave that just for reference, and
to look at if I hit any problems trying to to it 'my way' from scratch.
And yes, I agree about the VEC_? functions being imprecise due to vectors being VARs,
so If I find I NEED the precision, I will just write float-versions of the
vector functions needed.
Thanks again to all involved. Once Ive had a serious attempt to get this going,
I will post the rests and associated code too.
Cheers!