0 registered members (),
1,227
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Question for HUD Target Clamps
[Re: MikeS]
#309412
02/09/10 08:02
02/09/10 08:02
|
Joined: Jan 2010
Posts: 40 Adelaide, Australia
Sub_Game
Newbie
|
Newbie
Joined: Jan 2010
Posts: 40
Adelaide, Australia
|
Thanks SchokoKeks, I've made a basic bracket using line, scaled for range and it looks OK: ![](http://i899.photobucket.com/albums/ac192/Griller100/shot_bracket1.jpg) This is the code I used:
ENTITY* imp_unit;
VECTOR temp;
var tgt_dist;
for( i=1; i < UNIT_DATA_MAXUNITS; i++)
{
imp_unit = unit_data[i][UNIT_DATA_POINTER];
vec_set(temp.x,imp_unit.x);
if (NULL != vec_to_screen(temp,camera)) // if visible on screen
{
tgt_dist = vec_dist(camera.x,imp_unit.x);
draw_line(vector(temp.x-32768/tgt_dist, temp.y-4096/tgt_dist, 0), NULL, 40);
draw_line(vector(temp.x-32768/tgt_dist, temp.y+4096/tgt_dist, 0), vector(255,255,255), 40);
draw_line(vector(temp.x+32768/tgt_dist, temp.y+4096/tgt_dist, 0), vector(255,255,255), 40);
draw_line(vector(temp.x+32768/tgt_dist, temp.y-4096/tgt_dist, 0), vector(255,255,255), 40);
}
}
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|