Gamestudio Links
Zorro Links
Newest Posts
FXCM => AVA Trade Plugin???
by Martin_HH. 11/23/26 20:38
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (Martin_HH, LoT), 14,269 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
place model at 2D position? #179180
01/21/08 20:45
01/21/08 20:45
Joined: Jan 2004
Posts: 59
S
SH6811 Offline OP
Junior Member
SH6811  Offline OP
Junior Member
S

Joined: Jan 2004
Posts: 59
Hi,

When I "create" an entity I'd like to be able to simply position it using 2D coordinates, NOT 3D! Thus for example I'd like to create an entity and place it at screen coordinates 500x400...again not the "world coordinates"...how is this best accomplished? I'm having problems using vec_to_screen, it's probably not the correct command for this...thank you in advance.

Re: place model at 2D position? [Re: SH6811] #179181
01/22/08 07:35
01/22/08 07:35
Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
kasimir Offline
Senior Member
kasimir  Offline
Senior Member

Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
here is an example of vec_for_screen:

Code:

function mouse_to_level
{
var vec_from[3];
var vec_to[3];

vec_from.x = mouse_pos.x;//can also be your "2d coordinates"
vec_from.y = mouse_pos.y;//can also be your "2d coordinates"

vec_from.z = 10;

vec_set(vec_to,vec_from);
vec_for_screen(vec_from,camera);

vec_to.z = 100;//distance_from_screen
vec_for_screen(vec_to,camera);

trace_mode = ignore_me + ignore_sprites + ignore_models + ignore_passable;
return(trace(vec_from,vec_to));
}

function get_target
{
mouse_to_level();
ent_create("xxx.mdl,target.x,function);
}

on_mouse_left = get_target();


but perhaps its enougth if you use view-enitys?!

Re: place model at 2D position? [Re: kasimir] #179182
01/22/08 17:45
01/22/08 17:45
Joined: Jun 2004
Posts: 12
cweth Offline
Newbie
cweth  Offline
Newbie

Joined: Jun 2004
Posts: 12
how does the trace() function work, and what is "target.x"? this code creates an entity in the top right corner of screen regardless of where i click on the screen.

Re: place model at 2D position? [Re: cweth] #179183
01/22/08 17:58
01/22/08 17:58
Joined: Jan 2004
Posts: 59
S
SH6811 Offline OP
Junior Member
SH6811  Offline OP
Junior Member
S

Joined: Jan 2004
Posts: 59
Thanks for the reply. Is it possible for a View Entity to be made sensitive to mouse clicks and mouse hovers?


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | 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