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.

DarkBASIC Professional Discussion / How to Pick Up 3D Objects with a 2D Mouse Pointer?

Author
Message
Megaman X
21
Years of Service
User Offline
Joined: 21st Oct 2002
Location: Sweden
Posted: 24th Oct 2002 22:52
huh? I am trying to code a chess game with DB pro. How can I for exemple, use a image instead of the mouse default pointer( this is know how to do) and make some sort of "collisions" between the mouse and a 3D Object? I dont have a clue with DB...Like if I click in a Cube it prints "U clicked in a Cube"??? What commands should I use?

Thanks
dbellis
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 25th Oct 2002 01:06
you could use sprite collision make the mouse pointer a sprite and then do the collision checks

Damian

http://www.eclipsedevelopment.co.uk/
Succession The Betrayal Developer
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 25th Oct 2002 01:41
If the camera is fixed then you could do collisions with set boxes, or if the camera is free moving then use a 3d mouse pointer object. You could check the colour of the pixel that the mouse is over and use that for collision if the objects are different colours.
Megaman X
21
Years of Service
User Offline
Joined: 21st Oct 2002
Location: Sweden
Posted: 25th Oct 2002 01:59
thanks a lot for the replies Seems to be a lot of work but I will try to make it

Rogue
Jetmech
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Dayton Ohio
Posted: 26th Oct 2002 05:52
or you can use the " object screen x()" and " object screen y()" commands

something like this

if mousex() < object screen x(obj#)+10 and mousex() < object screen x(obj#)-10


ect. ect

Jetmech
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Dayton Ohio
Posted: 26th Oct 2002 05:54
actually I got the additions and subtractions backwards but you get the point

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 26th Oct 2002 05:56
there will be a 3d pick command looming soon in DBP.
The previous methods will work ok for now.

http://www.lunarpixel.com/ is my new site
Megaman X
21
Years of Service
User Offline
Joined: 21st Oct 2002
Location: Sweden
Posted: 26th Oct 2002 08:52
Thanks again for the replies. I will do my best and soon post a snap here, when it works

I don't suffer from insanity, I enjoy every minute of it.
-Rogue
Zero
21
Years of Service
User Offline
Joined: 28th Aug 2002
Location: Finland
Posted: 26th Oct 2002 18:28
"There will be a 3d pick command looming soon in DBP"

I once saw Guy mentioned something about command: object at screen(2d_x,2d_y) which will return the object number. Is this true?

The evil plan is now even closer!
- - - - - - - - - - - - - - - - - - - -
Specs:- P3 550 Nvidia TNT2M64, 192Mb RAM

Login to post a reply

Server time is: 2024-04-23 16:04:51
Your offset time is: 2024-04-23 16:04:51