0 registered members (),
1,209
guests, and 0
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Radarsystem
[Re: Superku]
#332220
07/08/10 08:42
07/08/10 08:42
|
Joined: May 2009
Posts: 445 Peine, Germany
Razoron
OP
Senior Member
|
OP
Senior Member
Joined: May 2009
Posts: 445
Peine, Germany
|
Okay, Winkel und Positionen gehen jetzt richtig. Es gibt aber immer noch ein Problem mit der größe der Pfeile. Sie sind 16*16 Pixel groß. Hier das Problem: Der korrekte Punkt, an dem sich das Flugzeug befindet: Und wenn man jetzt den Pfeil an dem Punkt als Panel anbringt, stimmt das nicht: Das kann man aber ganz einfach, da der Pfeil genau 16*16 Pixel groß ist, die pos_x und die pos_y um 8 verkleinern. Aber was ist, wenn man jetzt den Pfeil noch rotiert? Wie kann man das lösen? Ich weiß, die Bilder sind hübsch . EDIT: Ihr wisst immer noch nicht, was ich meine? Ich möchte es SO haben: oder helt bei einer Drehung so:
Last edited by Razoron; 07/08/10 09:56.
|
|
|
Re: Radarsystem
[Re: Razoron]
#332524
07/10/10 12:07
07/10/10 12:07
|
Joined: May 2009
Posts: 445 Peine, Germany
Razoron
OP
Senior Member
|
OP
Senior Member
Joined: May 2009
Posts: 445
Peine, Germany
|
Okay, es gibt noch ein Problem: Wenn ich das Flugzeug drehe, ist die Laufbahn bei einer Drehung des Symbols oval. Wenn die Flugzeuge Schnauze zu Schnauze gerichtet sind, also aufeinander gucken, bewegst sich das symbol fast nur noch auf der X-Achse, wenn sie Flügel zu Flügel gerichtet sind, also nebeneinander stehen, bewehst sich das Symbol fast nur auch der Y-Achse. Dazwischen ist die Laufbahn bei einer Drehung kreisrund, wie es sein soll. EDIT: Ach ja, hier nochmal der Code. Nicht über die Kommentare nachdenken, die sind alt.
draw.x=ent_MyPlane.x-ent_Plane[i].x;//The difference of the x position of my plane and the other one
draw.x=-(draw.x/7.8125); //Make it proportional to the screen and radar.
//The radar has a radius of 128, that means 5000/128=39.0625
draw.y=ent_MyPlane.y-ent_Plane[i].y;
draw.y=-abs(draw.y/7.8125);
draw.z=0;//We don't need the Z value, it's on the screen
vec_set(temp,ent_Plane[i].x);
vec_sub(temp,ent_MyPlane.x);
vec_to_angle(temp2,temp);
vec_set(drawoffset,vector(8,8,0)); //Set the offset because the symbol is 16*16 pixel big and the draw position would be on the top left corner. It should be in the middel of the symbol.
draw.x*=sin(camera.pan-temp2.pan);
draw.y*=cos(camera.pan-temp2.pan);
mgs=sin(camera.pan-temp2.pan);
parachutes=draw.x;
draw.x+=896*PROP_X; //Add the radar position, subtract the offset and make it proportional to the screen resolution
draw.y+=640*PROP_Y; //Same here
Last edited by Razoron; 07/10/10 12:09.
|
|
|
|