Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
vec_to_angle pointing to a entity #180509
01/28/08 18:57
01/28/08 18:57
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline OP
Serious User
PadMalcom  Offline OP
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Hi I have got a panel which should point onto an entity in my map (showing where the next quest begins). This entity is marked like this:

ENTITY* MyTarget;

action SetMyTarget() {
MyTarget = my;
}

Now I want to change the angle of a panel to point onto this target. Trying this wasn't a success:

Zeiger_panel.center_x = Zeiger_panel.size_x * 0.5;
Zeiger_panel.center_y = Zeiger_panel.size_y * 0.5;
while(1) {

while (MyTarget == null) {wait(1); beep;};
vec_set(temp,myTarget);
vec_sub(temp,player);
vec_to_angle(Zeiger_panel.angle,temp);
wait(1);
}
}

The panels angle didn't change at all Anybody knows why?

Re: vec_to_angle pointing to a entity [Re: PadMalcom] #180510
01/29/08 03:02
01/29/08 03:02
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
panel.angle isn't 3D (pan, tilt, roll)...

It's simply for rotating a panel (like roll)


xXxGuitar511
- Programmer
Re: vec_to_angle pointing to a entity [Re: xXxGuitar511] #180511
01/30/08 07:04
01/30/08 07:04
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline OP
Serious User
PadMalcom  Offline OP
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Yeah I know but the panels angle should be seen as x-rotation (pan?) like a compass pointing onto an entity but on north.

Re: vec_to_angle pointing to a entity [Re: PadMalcom] #180512
01/30/08 08:00
01/30/08 08:00
Joined: Jan 2007
Posts: 221
F
Fenriswolf Offline
Member
Fenriswolf  Offline
Member
F

Joined: Jan 2007
Posts: 221
In this case you could use vec_to_screen to transform the entities world coordinates to screen coordinates.
Then you should be able to use vec_diff and vec_to_angle to get the right angle for your panel.


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