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
1 registered members (TipmyPip), 18,449 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
Rating: 5
Page 1 of 2 1 2
accurate mouse3d function #166944
11/11/07 15:16
11/11/07 15:16
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline OP
Expert
Joozey  Offline 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 Offline
Expert
frazzle  Offline
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
N
nfs42 Offline
Serious User
nfs42  Offline
Serious User
N

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 Offline
Expert
Helghast  Offline
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


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: accurate mouse3d function [Re: Helghast] #166948
11/12/07 00:30
11/12/07 00:30
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline OP
Expert
Joozey  Offline OP
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Graag gedaan dan


Click and join the 3dgs irc community!
Room: #3dgs
Re: accurate mouse3d function [Re: Joozey] #166949
11/12/07 01:54
11/12/07 01:54
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Love it! even though I was using Georges, this one is cool too.

You hav'nt got a 3D compass we could use by any chance?

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 Offline OP
Expert
Joozey  Offline 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: Joozey] #166951
11/12/07 21:10
11/12/07 21:10
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
LOL (sorry, was just being cheeky in that post ...) but getting this is fantastic, again thanks! 5 stars man

Re: accurate mouse3d function [Re: Nems] #166952
11/29/07 05:10
11/29/07 05:10
Joined: Oct 2003
Posts: 827
22�21'24"N 114�07'30...
Frederick_Lim Offline
User
Frederick_Lim  Offline
User

Joined: Oct 2003
Posts: 827
22�21'24"N 114�07'30...
Oh I really need that. I can't figure out how to use mouse3d. I can replace the vec_for_screen now.
Thanks so much!

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 Offline
Expert
mpdeveloper_B  Offline
Expert

Joined: Feb 2006
Posts: 2,185
very very helpful for any point and click games "mmos, or adventure games especially"


- aka Manslayer101
Page 1 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

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