Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Akow, 1 invisible), 1,404 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Local co-ords to world co-ords #237459
11/20/08 08:19
11/20/08 08:19
Joined: Jul 2008
Posts: 54
Taipei, Taiwan
PlaystationThree Offline OP
Junior Member
PlaystationThree  Offline OP
Junior Member

Joined: Jul 2008
Posts: 54
Taipei, Taiwan
As the title says, is there a function to convert a local position to a world position? Or the other way? I know you can do it with basic maths, but is there a script like local_to_world or something?


Bet you don't know where Taiwan is lol.

"The Lord is my light and my salvation..." Psm 27:1
Re: Local co-ords to world co-ords [Re: PlaystationThree] #237485
11/20/08 10:31
11/20/08 10:31
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
what you mean with local Pos? You have only one position: x,y,z.

Re: Local co-ords to world co-ords [Re: Widi] #237486
11/20/08 10:37
11/20/08 10:37
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
we use only world coordinates. u need not convert.

if u want to manipulate a local object u can use its angle properties directly like pan, tilt, etc.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: Local co-ords to world co-ords [Re: delinkx] #237508
11/20/08 12:43
11/20/08 12:43
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
Quote:
vec_for_ent can be used to convert between world and entity coordinates.
vec_rotateback performs an inverse rotation.


Re: Local co-ords to world co-ords [Re: ventilator] #237528
11/20/08 15:01
11/20/08 15:01
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline
Member
heinekenbottle  Offline
Member

Joined: Oct 2008
Posts: 218
Nashua NH
Also, the second vector parameter in c_move uses world coordinates.


I was once Anonymous_Alcoholic.

Code Breakpoint;
Re: Local co-ords to world co-ords [Re: heinekenbottle] #239752
12/07/08 00:44
12/07/08 00:44
Joined: Jul 2008
Posts: 54
Taipei, Taiwan
PlaystationThree Offline OP
Junior Member
PlaystationThree  Offline OP
Junior Member

Joined: Jul 2008
Posts: 54
Taipei, Taiwan
yes but vec_to_mesh() uses local entity co-ords i.e. relative to itself. I'm trying to move an entity's vertex to world positions i.e. relative to world origin.


Bet you don't know where Taiwan is lol.

"The Lord is my light and my salvation..." Psm 27:1
Re: Local co-ords to world co-ords [Re: PlaystationThree] #239763
12/07/08 03:47
12/07/08 03:47
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Use this, as in

vec_to_mesh(local_to_world(Targ_Ent.x, Worldpos_Target.x), Targ_Ent, Targ_Vert);


Code:
VECTOR* local_to_world(VECTOR* Local, VECTOR* World)
{
   VECTOR tempV;
   vec_set(tempV.x, Local.x);
   vec_add_tempV.x, World.x);
   return(vector(tempV.x,tempV.y,tempV.z));
}



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Local co-ords to world co-ords [Re: EvilSOB] #239789
12/07/08 11:16
12/07/08 11:16
Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
That's interesting. The only correct answer in this whole thread was completely ignored. smile

Re: Local co-ords to world co-ords [Re: Tobias] #239804
12/07/08 13:52
12/07/08 13:52
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
IF you are talking about mine, its still early yet...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Local co-ords to world co-ords [Re: EvilSOB] #239805
12/07/08 14:25
12/07/08 14:25
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
you forgot the rotation, EvilSOB.

there already are the built-in functions vec_for_ent()/vec_to_ent() for this purpose though.

Page 1 of 2 1 2

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