Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, AndrewAMD, dBc), 18,430 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
3d mouse_pointer #337268
08/09/10 20:31
08/09/10 20:31
Joined: Apr 2008
Posts: 17
S
slowglider Offline OP
Newbie
slowglider  Offline OP
Newbie
S

Joined: Apr 2008
Posts: 17

i want to create some lvl editor like in trackmania

the things is how to get te point were the mouse is on the right hight

the rest i think i can handle myself but the problem is vec_for_screen only gots a distance instead i want to have it on a certain hight like z = 0 ore somting

hope you understand me en that some can help me

Re: 3d mouse_pointer [Re: slowglider] #337841
08/13/10 21:19
08/13/10 21:19
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67"...
hopfel Offline
User
hopfel  Offline
User

Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67"...
I made such a code a while ago, I hope its that what you're looking for:

Code:
VECTOR kreis_pos;
ANGLE kreis_ang;

while(1)
{

vec_set(kreis_pos,vector(mouse_pos.x,mouse_pos.y,10000));
vec_for_screen(kreis_pos,camera);

my.skill1=c_trace(camera.x,kreis_pos.x,IGNORE_SPRITES + IGNORE_MODELS);

vec_to_angle(kreis_ang,vector(kreis_pos.x-camera.x,kreis_pos.y-camera.y,kreis_pos.z-camera.z));
my.x=camera.x-(-my.skill1)*cos(kreis_ang.tilt)*cos(kreis_ang.pan);
my.y=camera.y-(-my.skill1)*cos(kreis_ang.tilt)*sin(kreis_ang.pan);
my.z=camera.z-(-my.skill1)*sin(kreis_ang.tilt);

wait(1);
}



my is the entity, which follows the mouse.
I think there's an easyer code but maybe you can use it. ^^


Hilf mir, dir zu helfen!
Re: 3d mouse_pointer [Re: hopfel] #337890
08/14/10 08:25
08/14/10 08:25
Joined: Apr 2008
Posts: 17
S
slowglider Offline OP
Newbie
slowglider  Offline OP
Newbie
S

Joined: Apr 2008
Posts: 17
thank buts not realy wat i want.

i want to give the heigth lets say z = 5 my entity wil always be my.z == 5 but then on the mouse_position

btw you reinvented the wheel there you could simple do this

Code:
vec_set(kreis_pos,vector(mouse_pos.x,mouse_pos.y,10000));
vec_for_screen(kreis_pos,camera);

my.skill1=c_trace(camera.x,kreis_pos.x,IGNORE_SPRITES + IGNORE_MODELS);

vec_set(kreis_pos,vector(mouse_pos.x,mouse_pos.y,my.skill1));
vec_for_screen(kreis_pos,camera);
vec_set(my.x,kreis_pos);



Re: 3d mouse_pointer [Re: slowglider] #337901
08/14/10 10:58
08/14/10 10:58
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67"...
hopfel Offline
User
hopfel  Offline
User

Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67"...
Quote:
i want to give the heigth lets say z = 5 my entity wil always be my.z == 5 but then on the mouse_position


I think the best way for that is using trigonometry:

Code:
VECTOR kreis_pos;
ANGLE kreis_ang;

while(1)
{

vec_set(kreis_pos,vector(mouse_pos.x,mouse_pos.y,10000));
vec_for_screen(kreis_pos,camera);

vec_to_angle(kreis_ang,vector(kreis_pos.x-camera.x,kreis_pos.y-camera.y,kreis_pos.z-camera.z));

my.x=camera.x+(camera.z-5)*(tanv(kreis_ang.tilt-90))*cos(kreis_ang.pan);
my.y=camera.y+(camera.z-5)*(tanv(kreis_ang.tilt-90))*sin(kreis_ang.pan);
my.z=5;

wait(1);
}



Is it that what you mean?


Hilf mir, dir zu helfen!
Re: 3d mouse_pointer [Re: hopfel] #337921
08/14/10 13:55
08/14/10 13:55
Joined: Apr 2008
Posts: 17
S
slowglider Offline OP
Newbie
slowglider  Offline OP
Newbie
S

Joined: Apr 2008
Posts: 17
yeah many thanx it works great


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