3 registered members (Ayumi, Akow, AndrewAMD),
1,505
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Problem with Compass!!/problem mit kompass
#414244
12/27/12 15:54
12/27/12 15:54
|
Joined: Nov 2012
Posts: 32
thorus
OP
Newbie
|
OP
Newbie
Joined: Nov 2012
Posts: 32
|
hy guys i have made a battlefield style compass.. where in a window the compass pan show n e s w (without needle), the problem is when i have reach camera.pan 360, then the compass doesnt move anymore.. till i turn backwar 360.. hope u understand -------------------------------------------------------------- ich hab einen battlefield style kompass also ein Kompass Band ohne Nadel, das sich mit der kamera mitdrehen soll, macht es auch aber sobald ich 360 pan von der kamera erreicht habe dreht sich der kompass nicht mehr mit, bis ich mit in die entgegengesetzte richtung wieder drehe.. hier der Code-> --------------------------------------------------------------
BMAP* kompass_tga = "kompass.tga"; // compassband
PANEL* kompass_pan = // compass
{
window (310, 4, 80, 48, kompass_tga, vkompass, 0);
flags = VISIBLE;
layer = 5;
}
pann = camera.pan;
vkompass=integer(pann/2)+5;
|
|
|
Re: Problem with Compass!!/problem mit kompass
[Re: thorus]
#414253
12/27/12 17:24
12/27/12 17:24
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
Du kannst cycle benutzen, um camera.pan in einem bestimmten bereich zu halten:
camera.pan = cycle(camera.pan, 0, 360);
EDIT: bzw. anstatt pann = camera.pan; einfach pann = cycle(camera.pan, 0, 360); verwenden
Last edited by Kartoffel; 12/27/12 17:27.
POTATO-MAN saves the day! - Random
|
|
|
Re: Problem with Compass!!/problem mit kompass
[Re: thorus]
#414263
12/27/12 21:00
12/27/12 21:00
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
wenn die waffe an camera.pan angepasst wird, benutz das zweite beispiel, also: pann = cycle(camera.pan, 0, 360);
damit wird camera.pan an sich nicht verändert, was den fehler beheben sollte
Last edited by Kartoffel; 12/27/12 21:10.
POTATO-MAN saves the day! - Random
|
|
|
|