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 Discussion / 2 questions from newbie??

Author
Message
ScottyB
18
Years of Service
User Offline
Joined: 26th Jul 2007
Location:
Posted: 3rd Aug 2007 08:03
I am writeing a program and I'm haveing two problems at this point.

I got the mouse working in 2 dimension screen
and I would like have it point to a 3d point in space.

Like when you shoot a laser and two beams go out of your spaceship
and head directly where you are pointing with your mouse.

they are two different units though mouse 2d screen and space 3d.
Any ideas?

Lastly,

How do you detect collision between two objects both 3d?

Thanks
Any help would be greatly appreciated.
SAB
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
roddman
18
Years of Service
User Offline
Joined: 24th Jul 2007
Location: Over There
Posted: 3rd Aug 2007 16:12
The collision detection is fairly easy, you can use MAKE OBJECT COLLISION BOX and OBJECT COLLISION(object1,object2) to get collision data.

But making the mouse point to a 3 dimensional location is much harder and requires some math. Especially if you want to be able to change the depth of that point. I don't think there is a command in DBC that returns a point in space from a point on the screen, I could be wrong though.

Like TDK said I suggest you start out learning the basics (variables, float variables, strings, loops, etc.)

Cory
luke810
19
Years of Service
User Offline
Joined: 4th Sep 2006
Location: United States
Posted: 3rd Aug 2007 16:47
For the mouse thing I would suggest using a combination of sparky's collision DLL and the mouse vector function from underware designs matrix selection program or writing your own 2d to 3d vector routine. If you search google there are alot of sites that walk you through it.

http://underwaredesign.com/prod_detail.php?rnd=78135299&id=20
ScottyB
18
Years of Service
User Offline
Joined: 26th Jul 2007
Location:
Posted: 3rd Aug 2007 21:08
Thanks guys for the posts.
Lots of code to look at now.

Login to post a reply

Server time is: 2026-07-06 03:59:41
Your offset time is: 2026-07-06 03:59:41