0 registered members (),
1,209
guests, and 0
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Merge 2 Meshes/Entities during game...
[Re: Benni003]
#402024
05/28/12 21:07
05/28/12 21:07
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
@Wjbender, thank you for this great contribution! I post this late answer, because I was worrying about that the merging wasn't perfect, there are some triangles off. I don't get that solved. I would be happy, if anybody offers an advice how to solve this!
Last edited by Pappenheimer; 05/28/12 22:57.
|
|
|
Re: Merge 2 Meshes/Entities during game...
[Re: Pappenheimer]
#402164
05/30/12 19:40
05/30/12 19:40
|
Joined: Mar 2012
Posts: 927 cyberspace
Wjbender
User
|
User
Joined: Mar 2012
Posts: 927
cyberspace
|
Hi. I have not tested this much myself .it was more of a proof pf concept written in an understandable manner for the poster of this thread . I could look into it a bit further and see if perhaps i may be of help to you, provided that you go into a bit more detail so that i may try and see what you see
Compulsive compiler
|
|
|
Re: Merge 2 Meshes/Entities during game...
[Re: Pappenheimer]
#402222
05/31/12 16:48
05/31/12 16:48
|
Joined: Mar 2012
Posts: 927 cyberspace
Wjbender
User
|
User
Joined: Mar 2012
Posts: 927
cyberspace
|
Okay now i understand ,yes the rest of the function was poorly written i was wondering how to achieve orientation and position and scale and skins perhaps getmesh would return buffer with all that rotation positiom scale? I havent tried it yet .position and scale shouldnt be to hard its the rotation that bothers me im not very good with vectors and matrices. It would be Great if you are able to solve the function
Compulsive compiler
|
|
|
Re: Merge 2 Meshes/Entities during game...
[Re: Wjbender]
#402225
05/31/12 17:18
05/31/12 17:18
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
Maybe, one has to start with setting a center of the new model, and after that measure the vertex positions in relation to that center point.
Relaating the skin, I'm planing to sew the skins into one bitmap, and shift the vs depending the position of the models skin within the new bitmap.
Anyway, thank you very much for your base work, without it I wouldn't have any start at all.
|
|
|
Re: Merge 2 Meshes/Entities during game...
[Re: Pappenheimer]
#402226
05/31/12 17:54
05/31/12 17:54
|
Joined: Mar 2012
Posts: 927 cyberspace
Wjbender
User
|
User
Joined: Mar 2012
Posts: 927
cyberspace
|
That sounds great best of luck . Heres some form of code i have used before x=meshpos.x+vertex.x*scale.x same for y and z x being the new vertex position and scale taken from the source models position,vertex,scale rotation i have no idea . Anyway sure you wil solve it better and if you do could i ask for help with rotating vertices as i need it for my navmesh project?
Compulsive compiler
|
|
|
Re: Merge 2 Meshes/Entities during game...
[Re: Pappenheimer]
#402240
05/31/12 22:14
05/31/12 22:14
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
I got the rotation working. It is vec_rotate, inserted with VECTOR temp1; and the switch from y and z in the following way:
for (iterate=0;iterate<vertices1;iterate++)
{
temp1.x=vertex_buffer1[iterate].x;
temp1.y=vertex_buffer1[iterate].z;
temp1.z=vertex_buffer1[iterate].y;
vec_rotate(temp1.x, source1.pan);
merged_vertex_buffer[iterate].x=temp1.x;
merged_vertex_buffer[iterate].y=temp1.z;
merged_vertex_buffer[iterate].z=temp1.y;
merged_vertex_buffer[iterate].u1=vertex_buffer1[iterate].u1;
merged_vertex_buffer[iterate].v1=vertex_buffer1[iterate].v1;
merged_vertex_buffer[iterate].u2=vertex_buffer1[iterate].u2;
merged_vertex_buffer[iterate].v2=vertex_buffer1[iterate].v2;
}
offsetv+=vertices1;
for (iterate=0;iterate<vertices2;iterate++)
{
temp1.x=vertex_buffer1[iterate].x;
temp1.y=vertex_buffer1[iterate].z;
temp1.z=vertex_buffer1[iterate].y;
vec_rotate(temp1.x, source2.pan);
merged_vertex_buffer[iterate+offsetv].x=temp1.x;
merged_vertex_buffer[iterate+offsetv].y=temp1.z;
merged_vertex_buffer[iterate+offsetv].z=temp1.y;
merged_vertex_buffer[iterate+offsetv].u1=vertex_buffer2[iterate].u1;
merged_vertex_buffer[iterate+offsetv].v1=vertex_buffer2[iterate].v1;
merged_vertex_buffer[iterate+offsetv].u2=vertex_buffer2[iterate].u2;
merged_vertex_buffer[iterate+offsetv].v2=vertex_buffer2[iterate].v2;
}
|
|
|
|