Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, alibaba), 1,184 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
vec_for_screen to place objects #175732
01/01/08 19:07
01/01/08 19:07
Joined: Mar 2004
Posts: 286
Maintal, Deutschland
TheTommynator Offline OP
Member
TheTommynator  Offline OP
Member

Joined: Mar 2004
Posts: 286
Maintal, Deutschland
Hello,

I'm trying to use vec_for_screen to place objects on the ground by using the mouse.

But in everything I tried the object were misplaced.

So what I'm asking for is a small expample of code on how to place an object (ent_create) on ground using vec_for_screen to create it.

Thanks
TheTommynator

[GERMAN]

Hallo,

Ich bin auf der Suche nach einem Weg die vec_for_screen Anweisung zu verwenden um Objekte mit Hilfe der Maus auf dem Boden zu platzieren.

Bei all meinen Versuchen waren die Objekte allerdings irgendwie immer verschoben.

Also bin ich auf der Suche nach einem Code-Beispiel mit dessen Hilfe ich Objekte (über ent_create) auf dem Boden platzieren kann mit Hilfe von vec_for_screen.

Danke
TheTommynator


Back @ work with 3DGS.
Re: vec_for_screen to place objects [Re: TheTommynator] #175733
01/02/08 15:12
01/02/08 15:12
Joined: Apr 2006
Posts: 624
DEEP 13
badapple Offline
User
badapple  Offline
User

Joined: Apr 2006
Posts: 624
DEEP 13
hello i have made a small demo that does this for you , i was going to place on
my site for download but cant get in right now due to some server problem thier
having , i cant complain though first time this has happened and its free .
soooo you can either wait until i can get up on site or pm me an email address
and ill send it
cheers

Re: vec_for_screen to place objects [Re: badapple] #175734
01/02/08 16:59
01/02/08 16:59
Joined: Jan 2007
Posts: 221
F
Fenriswolf Offline
Member
Fenriswolf  Offline
Member
F

Joined: Jan 2007
Posts: 221
Hello,

you could try something like this:
Code:
VECTOR vec_to; // target vector of mouse trace

vec_set(vec_to, mouse_dir3d);
vec_normalize(vec_to, 4000); // length of trace

// trace from mouse position to target vector.
c_trace(mouse_dir3d, vec_to, IGNORE_ME|IGNORE_PASSABLE);

if (trace_hit) ent_create(.., target,..);



Re: vec_for_screen to place objects [Re: Fenriswolf] #175735
01/02/08 17:05
01/02/08 17:05
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands

Last edited by Joozey; 01/02/08 17:05.

Click and join the 3dgs irc community!
Room: #3dgs

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

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