Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / 3d mouse location

Author
Message
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 10th Jan 2004 11:38
ok....i got DBPro and i am learning a bit about it, but what i want to do is be able to get the 3d location of the mouse on the screen, at a certain distance from the camera.....i know a little about pick screen and such, but it seems very complicated....could someone help me out a little? thnx in advance

Bishop

"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 10th Jan 2004 13:36
Check the codebase. This has been asked for many times in the past.
Or, you could take a look at this post.
http://www.dannywartnaby.co.uk/rgt/index.php?board=18;action=display;threadid=1360
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 10th Jan 2004 14:12
Here's the example code snippet that comes with DBP:



Quote: "PICK SCREEN
This command will calculate a relative 3D coordinate from a 2D screen coordinate. The additional Distance parameter
indicates how far into the screen the 3D coordinate is to be calculated. The resulting 3D coordinate is not a world
position, but a relative 3D vector from the current camera position. The world coordinate can be obtained by adding the
camera position to the resulting vector. The resulting vector is generated internally and can be retrieved using the GET
PICK VECTOR commands.

SYNTAX
PICK SCREEN Screen X, Screen Y, Distance"


Basically, the pick screen command will generate 3d co-ordinates relative to the camera position. For exmaple, if the camera is at 10,10,10 and the co-ordinates generated are 1,2,3 then the position will be 11,12,13.

At least I think that's what it means

"Nowadays more and more of our imports are coming from abroad" - George Bush

Formerly David89.
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 10th Jan 2004 22:27
thanx alot guys! Phaelax i went there and there seem to be alot of good snippits....thanks alot!

Thanx again everyone,
Bishop

"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 11th Jan 2004 13:16
@David, Pick Screen() does not generate coordinates. It generates a vector. If you want to get coordinates you have to apply the vector to some starting coordinates.

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P1.3ghz / 384 megs / GeForce MX 5200 128meg / WinXP home
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 11th Jan 2004 21:19
This shows usage of PICK SCREEN. It will tell you world coordinates at a set distance from camera depending on where mouse pointer is.



Boo!

Login to post a reply

Server time is: 2024-09-21 15:50:59
Your offset time is: 2024-09-21 15:50:59