deforming skinned model

Posted By: Dark_samurai

deforming skinned model - 02/11/12 10:53

Hi guys,

I'm deforming a model in realtime through ent_setvertex(). This works great as long as there is no uv mapping assigned to the model. But if the model (created in MED) was skinned with the "6 side mapping" tool of MED, the defomring doesn't work:



This is how it should look like:



It seems like the mesh was splitted through the skinmapping. Maybe this is because every vertex occures 3 times in the uv mapping (one vertex is shared by 3 sides of the cube and through the 6 side mapping every side is seperate in the uv mapping):



What can I do to overcome this problem? Do I have to update the uv mapping (btw. how can I do this)?

Thanks for your help!
Posted By: HeelX

Re: deforming skinned model - 02/11/12 12:21

No, it seems that the vertices are not snapped together. Select all vertices and click on "merge".
Posted By: Dark_samurai

Re: deforming skinned model - 02/11/12 12:59

Thanks for your reply. I just checked the model and it has only 8 vertice for sure!

My theory: A vertex can have only 1 uv coordinate. But the uv mapping created with "create 6 side mapping" needs at least 3 vertices per "real" vertex because otherwise it won't be possible to split the sides of the cube as shown in the skin editor screenshot. But I think the 2 additional vertices are somehow hided by the engine and not returned through ent_getvertex(). Thus I can only change one of those vertices which leads to the strange behavior. What do you think?
Posted By: Superku

Re: deforming skinned model - 02/11/12 17:30

Works fine for me:

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


void main()
{
	fps_max = 60;
	level_load(NULL);
	camera.x = -100;
	you = ent_create("cube.mdl",nullvector,NULL);
	CONTACT* c = ent_getvertex(you,NULL,2);
	c.z += 10;
	c.v = NULL;
	ent_setvertex(you,c,2);
}


Posted By: Dark_samurai

Re: deforming skinned model - 02/11/12 19:26

Superku are you sure that your model has the same skin mapping as mine (see screenshot)? All vertex that occure only 1 time in the uv mapping also work for me (you only try 1 vertex so maybe you had luck).

Could you upload the model if the error still doesn't occur for you? Thanks laugh

Btw. if I want to create a mesh that has seperated sides like in the skin mapping screenshot, how would I have to do that? I see no other way than creating the same vertex more than once (because one vertex can't have different uv coordinates)?
Posted By: MrGuest

Re: deforming skinned model - 02/11/12 19:50

i remember having a similar problem, using ent_fixnormals(you, your.frame) might help?
Posted By: Superku

Re: deforming skinned model - 02/11/12 19:51

Yes, here's the model:
http://www.superku.de/cube.mdl
Posted By: Dark_samurai

Re: deforming skinned model - 02/12/12 10:46

Thanks MrGuest, ent_fixnormals() fixes the problem laugh
© 2024 lite-C Forums