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 / 2D Selection of 3D objects

Author
Message
luke810
19
Years of Service
User Offline
Joined: 4th Sep 2006
Location: United States
Posted: 16th Jul 2007 08:46
Could someone with sparky's collision DLL test this out for me please? My DarkBasic program hasn't been working correctly lately so I can't try it out and I really need it.

All you have to do is run a program with an object set to collision on with sparky's DLL in group 'GroupNum' and see if the return value of the second function after calling the first function is the number of the object on screen under the mouse cursor.

BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 26th Jul 2007 04:23 Edited at: 26th Jul 2007 04:24
I can't get this to run...I tried some troubleshooting but there are just too many problems.
First it complained because your variable MouseX and MouseY are commands also, so they can't be variables. Fixed that by adding "a" to all of those.
Then it complained because you were trying to use floats to reference an array, and then I gave up because I got:
Quote: "Cannot find structure 'Get_Mouse_Vector':MouseVector'in local declaration at line 76."

At that point I gave up.

(Sorry, but this probably has something to do with the fact that I use DarkBASIC Pro)

However, I encourage someone with DBC to test this, I've been looking for something to do this for a long time. Thanks

Sorry if I was a completely unhelpful waste of space


"Of course you should fight fire with fire. You should fight everything with fire!" —Jaya Ballard, task mage
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 26th Jul 2007 06:51
@luke810

I just tried this out in DBC and the only value that returned was zero.

Part of the problem is I don't think you are giving enough information on how the environment should be set up for the collision detection. Also



What are these values? What are they based on? The distance from the camera to what? The full camera range? The first object to detect for collision? Are these vectors across the screen or into the screen? Is it the size of the object(s)?

Enjoy your day.
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 26th Jul 2007 10:52
This is what the current DB challenge is based on, so check there every once and a while and you might be able to get some tips .
You could even enter your program if you get it working .

I am king of the noobs!
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 26th Jul 2007 11:59
@Obese87

Unfortunately, the method luke810 is using requires a collision DLL which isn't allowed in the challenges. However, the method could be modified to use the built in DBC collision.

Enjoy your day.
luke810
19
Years of Service
User Offline
Joined: 4th Sep 2006
Location: United States
Posted: 27th Jul 2007 22:04
The start and end distance are the distances the vector in the 3d world extends out from the camera's position. The function creates a three dimensional vector based on the mouse position, it doesnt have anything to do with getting the on screen position of the objects in the environment. And sorry about the mouse variable thing, I had the mouse positions saved in arrays originally but when I couldn't get DarkBasic to work on my computer I modified it to see if anyone could check if it worked. I've gotten it to work using a friend's computer now though, but thanks anyway.

Login to post a reply

Server time is: 2026-07-06 01:19:09
Your offset time is: 2026-07-06 01:19:09