Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 1,170 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Question for HUD Target Clamps #303626
12/30/09 16:42
12/30/09 16:42
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
Maybe someone has an idea of placing target clamps with an panel around an entity?

The placement itselfs is done,

the problem is, to get the panel always in the proper scale depending on distance to camera.

Thanks for your help

Greetings

Mike

Re: Question for HUD Target Clamps [Re: MikeS] #309231
02/08/10 02:25
02/08/10 02:25
Joined: Jan 2010
Posts: 40
Adelaide, Australia
Sub_Game Offline
Newbie
Sub_Game  Offline
Newbie

Joined: Jan 2010
Posts: 40
Adelaide, Australia
I'm working on this myself. I need target clamps for an ingame HUD.

Anyone?


A7 Commercial
First person submarine combat simulator project
http://alexanderforeman.webs.com/fightersubgame.htm
Re: Question for HUD Target Clamps [Re: Sub_Game] #309239
02/08/10 03:58
02/08/10 03:58
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
also interested in this..

Re: Question for HUD Target Clamps [Re: darkinferno] #309324
02/08/10 16:56
02/08/10 16:56
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
anyone?

Re: Question for HUD Target Clamps [Re: darkinferno] #309326
02/08/10 17:23
02/08/10 17:23
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
gimme a moment.. i think i have a script i made before


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Question for HUD Target Clamps [Re: alibaba] #309327
02/08/10 17:29
02/08/10 17:29
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
sorry cant find it frown


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Question for HUD Target Clamps [Re: alibaba] #309328
02/08/10 17:37
02/08/10 17:37
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
ahh, well anyone else? making a menu system that fits all resolutions is quite a pain

Re: Question for HUD Target Clamps [Re: darkinferno] #309340
02/08/10 18:54
02/08/10 18:54
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline
User
SchokoKeks  Offline
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
if you want it independent from the resolution and to be scaled depending on distance, you might use draw_line() and some vector arithmetics.
That line will always be one pixel in size, you'll have to make it shorter and longer depending on the distance (vec_dist).

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 Offline
Newbie
Sub_Game  Offline
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:





This is the code I used:

Code:
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);
   		
 	 }
}




A7 Commercial
First person submarine combat simulator project
http://alexanderforeman.webs.com/fightersubgame.htm
Re: Question for HUD Target Clamps [Re: Sub_Game] #309433
02/09/10 11:07
02/09/10 11:07
Joined: Mar 2007
Posts: 112
MikeS Offline OP
Member
MikeS  Offline OP
Member

Joined: Mar 2007
Posts: 112
Allright, that points me to the right direction.

I did not use camera distance.

But how would the mathematical term be to calculate the correct scale for the pannel?

What do i need?

Height and width of the model, camera distance, height and width of the pannelbmap?

and how to calculate the correct scale for the bmap?
Assuming that the original of the bmap has the scale 1, how do i calculate the 0.xxx scale to fit for the model?

Hope u know what i wanna say.

Greetings

Mike

Page 1 of 2 1 2

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