Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,388 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Origin of the model.. #290918
09/22/09 12:04
09/22/09 12:04
Joined: Apr 2009
Posts: 248
Philippines
seecah Offline OP
Member
seecah  Offline OP
Member

Joined: Apr 2009
Posts: 248
Philippines
Is there any way by MED or by codes to transfer the origin of the model from the tail part to its center?

I've tried to use min_xyz and max_xyz but no luck..

I want to transfer my origin since the shadow being cast from the model is not at the center instead it is at the end part..

Please advise..

Thanks

Last edited by seecah; 09/22/09 12:30.


Can't is not an option™
Re: Origin of the model.. [Re: seecah] #290997
09/22/09 20:07
09/22/09 20:07
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Happy Birthday Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
In MED:
Edit -> Transform model global -> Center model

Alternative: select everything and just move it for an off-center origin

In Realtime with lite-c:
Move every Vertex in the opposite direction

Example Code:
Code:
void ent_movevertex(ENTITY* ent, VECTOR* pos, int num){
	
	CONTACT* c = ent_getvertex(ent, NULL, num);
	c->v.x = pos->x;
	c->v.y = pos->z;
	c->v.z = pos->y;
	ent_setvertex(ent, c, num);
}

void moveOriginBy(ENTITY* ent, VECTOR* offset){
	int i;
	VECTOR move;
	vec_set(move, offset);
	vec_inverse(move);
	int vNum = ent_vertices(ent);
	for(i=0;i<vNum;i++){
		ent_movevertex(ent, move, i+1);
	}
}



Note: this will change every entity with the same model file - to avoid that use: ent_clone

Re: Origin of the model.. [Re: Scorpion] #291059
09/23/09 07:37
09/23/09 07:37
Joined: Apr 2009
Posts: 248
Philippines
seecah Offline OP
Member
seecah  Offline OP
Member

Joined: Apr 2009
Posts: 248
Philippines
Thanks Dude.. such a great solution.. I didn't see before the Center Model function in MED.. frown

Thank you so much!!! Such a lot of time wasted for this but the solution is just that simple..



Can't is not an option™

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

Gamestudio download | 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