ent_fixnormals - error?

Posted By: jenGs

ent_fixnormals - error? - 02/25/12 22:43

Hallo,
I have to ask now. What the hell is wrong with ent_fixnormals.
I modified a mdl (not a terrain) with ent_setvertex and used
ent_fixnormals(ent, 1) after the manipulation
(I tried also 0 for the frame parameter). The problem: each time
I call fixnormals the meash is reset to its original state. That's
realy annoiying. I didn't post it in the bugs forum, because I
am hoping I missed something.
Posted By: EvilSOB

Re: ent_fixnormals - error? - 02/26/12 01:32

Ive come across this problem before and never got a good answer to why.

BUT, the fix for me was to use "ent_fixnormals(ent, ent.frame);"


Hope this is of some help...
Posted By: Hummel

Re: ent_fixnormals - error? - 02/26/12 05:41

I donīt see the error here. When calculating the normals for frame X why should the entity be in an other state than frame X?
Posted By: jenGs

Re: ent_fixnormals - error? - 02/26/12 07:24

@EvilSOB
unfortunately that doesn't fix the problem for me, but thank you for your suggestion.

@Hummel
That's the thing I don't understand here. I do some heavy vertex manipulations, I added the wireframe material to see if the mesh is realy modified. If I don't call fixnormals, the mesh is modified like it is supposed to be. But even if I use fixnormals a lot of frames later (or in the same frame), the mesh is reset to it's original state. And to be sure, no mdl has any frames (one of course).
Posted By: Hummel

Re: ent_fixnormals - error? - 02/26/12 11:35

Ahh, now I got it: it resets your deformation also. Well, thatīs definitely not correct. Best is you upload a small sample project showing the prob so others can check whatīs going wrong there.
Posted By: rojart

Re: ent_fixnormals - error? - 02/26/12 13:39

Try with D3DXComputeNormals, like code below:

Code:
function on_n_event()
{ 
	while (key_n){wait (1);}
	
	LPD3DXMESH Mesh = ent_getmesh(ent, 0, 0);

	D3DXComputeNormals(Mesh, 0);

	ent_setmesh(ent, Mesh, 0, 0);
}


Posted By: jenGs

Re: ent_fixnormals - error? - 02/26/12 19:31

Thank you rojart. that helps. It is a good workaround. Perhaps it is even how ent_fixnormals should do the job.

I will put a small example together to show how this "bug" works.
Even if there is a workaround the function should work (or be on the bug list)
Posted By: jcl

Re: ent_fixnormals - error? - 02/27/12 13:39

This was already reported for terrain some time ago. It is fixed in the latest version.
Posted By: EvilSOB

Re: ent_fixnormals - error? - 02/27/12 16:25

Can you say WHICH version that is?

Is it a public version? Or is still in 'closed' beta?

Thankx
Posted By: jcl

Re: ent_fixnormals - error? - 02/28/12 09:02

It's the beta. But if someone needs the beta for testing such a particular problem, please PM me - I can submit a link.
Posted By: EvilSOB

Re: ent_fixnormals - error? - 02/28/12 09:45

Not me, its cool. Im not going to be dealing with that problem for a while yet.

Thanks anyways.
Posted By: jenGs

Re: ent_fixnormals - error? - 02/28/12 11:41

I don't need it either. Gamestudio is only a hobby for me and I can live with the workaround until the public beta come's out.
I don't work enough with the program to "test" such a thing. (once in a week)
© 2024 lite-C Forums