Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (EternallyCurious, AndrewAMD, TipmyPip, Quad), 889 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 5 1 2 3 4 5
Re: Merge 2 Meshes/Entities during game... [Re: Ch40zzC0d3r] #400936
05/10/12 06:57
05/10/12 06:57
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
Thanks, I wrote MasterQ32, but I still haven't an answer yet. We will see wink

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 Offline
Senior Expert
Pappenheimer  Offline
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! laugh

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
W
Wjbender Offline
User
Wjbender  Offline
User
W

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: Wjbender] #402172
05/30/12 22:32
05/30/12 22:32
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Okay, after another bunch of tests I nailed it down to the relation between vertices of the model and the vertices needed for its skin.
When their numbers are identical, then everything is fine.

Re: Merge 2 Meshes/Entities during game... [Re: Pappenheimer] #402217
05/31/12 15:58
05/31/12 15:58
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Got it!

You need the number of vertices including the vertices that are duplicated due to the skin uvs.

Replace:
int vertices1=ent_vertices(source1);
int vertices2=ent_vertices(source2);

with
int vertices1=ent_status(source1,1);
int vertices2=ent_status(source2,1);

Now, I hope to find a way to include the position, scale and rotation of the models.
Last point is to use the different skins as well.

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
W
Wjbender Offline
User
Wjbender  Offline
User
W

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 Offline
Senior Expert
Pappenheimer  Offline
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
W
Wjbender Offline
User
Wjbender  Offline
User
W

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: Wjbender] #402236
05/31/12 21:13
05/31/12 21:13
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
As soon as I know a solution, I share it!

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 Offline
Senior Expert
Pappenheimer  Offline
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:

Code:
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;
			
		}



Page 2 of 5 1 2 3 4 5

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1