2 registered members (NnamueN, 1 invisible),
1,489
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
accurate mouse3d function
#166944
11/11/07 15:16
11/11/07 15:16
|
Joined: Oct 2004
Posts: 4,134 Netherlands
Joozey
OP
Expert
|
OP
Expert
Joined: Oct 2004
Posts: 4,134
Netherlands
|
I'm sure somebody post such a code before, nevertheless heres my version of it: Code:
VECTOR mouse_click; //var mouse_click[3] for c-script
function mouseTo3D() { while (1) { if (mouse_left) { vec_set (mouse_click, mouse_dir3d); //get direction vector from mouse to world vec_normalize(mouse_click, 4000); //give it a large distance for tracing vec_add (mouse_click, camera.x); //calculate from camera position c_trace (camera.x, mouse_click, IGNORE_MODELS); //trace from camera to clicked position (= mouse position + 4000 in depth) ent_create ("warlock.mdl", target.x, NULL); //accurate warlock placement! } wait(1) } }
Click and join the 3dgs irc community! Room: #3dgs
|
|
|
Re: accurate mouse3d function
[Re: Joozey]
#166945
11/11/07 15:25
11/11/07 15:25
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
Nice version Joozey, thanks for the effort Cheers Frazzle
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
Re: accurate mouse3d function
[Re: Joozey]
#166946
11/11/07 16:56
11/11/07 16:56
|
Joined: Jun 2001
Posts: 1,004 Dossenbach
nfs42
Serious User
|
Serious User
Joined: Jun 2001
Posts: 1,004
Dossenbach
|
nice, added to 3DGS Codebase
Andreas GSTools - Home of GSTScript 0.9.8: lua scripting for A6/7/8 GSTNet 0.7.9.20: network plugin for A6/7/8 GSTsqlite 1.3.7: sql database plugin for A6/7/8 3DGS Codebase: 57 snippets || 3DGS Downloads: 248 files
|
|
|
Re: accurate mouse3d function
[Re: Joozey]
#166947
11/11/07 23:10
11/11/07 23:10
|
Joined: Jan 2004
Posts: 3,023 The Netherlands
Helghast
Expert
|
Expert
Joined: Jan 2004
Posts: 3,023
The Netherlands
|
REALLY nice snippit there! no other words then great, i know besides me a lot of people have great use for this. again thannk, you rock! regards, PS: serieus, ik was echt op zoek naar deze code een paar weken geleden
|
|
|
Re: accurate mouse3d function
[Re: Nems]
#166950
11/12/07 17:45
11/12/07 17:45
|
Joined: Oct 2004
Posts: 4,134 Netherlands
Joozey
OP
Expert
|
OP
Expert
Joined: Oct 2004
Posts: 4,134
Netherlands
|
Quote:
You hav'nt got a 3D compass we could use by any chance?
Gah, don't start about angles
Click and join the 3dgs irc community! Room: #3dgs
|
|
|
Re: accurate mouse3d function
[Re: Frederick_Lim]
#166953
11/29/07 06:35
11/29/07 06:35
|
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B
Expert
|
Expert
Joined: Feb 2006
Posts: 2,185
|
very very helpful for any point and click games "mmos, or adventure games especially"
- aka Manslayer101
|
|
|
|