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.

Author
Message
madcaddy
23
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 8th Apr 2003 21:04
hi, just a couple of questions on making a rts game.

firstly could someone give a good method for determining whether the mouse is over an object? ive done a simple one using the mouse coordinates, object position and object size but is isnt 100% efficient and can't be the best way.

also i need to determine the x and z world coordinates under the mouse cursor - i played around with a routine using mouse coordinates and camera position but cudnt get it to work.

any help would be great - thx.
EddieRay
23
Years of Service
User Offline
Joined: 28th Feb 2003
Location: USA
Posted: 8th Apr 2003 21:57
This question was asked a while back... one suggestion was to hide the normal mouse and create a 3D mouse cursor - and update it's position in 3D space based movement amounts returned by mousemovex() and mousemovey().

I don't know enough about the viewing system in DBPro to tell you how to intersect a ray from the camera with your game world. It *should* be possible tho'.

Hope this helps...

Ed

madcaddy
23
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 8th Apr 2003 22:00
ah ok, thanks for the idea - if i managed to create a 3d mouse cursor, the task of finding out whether the mouse is over an object should be a lot easier.. thx again
malcom2073
23
Years of Service
User Offline
Joined: 12th Mar 2003
Location:
Posted: 9th Apr 2003 06:57


ms is the number of a sphere object that is size 10. (used for collision detection). thats your 3d mouse cursor. It only works above a certain range from the matrix though.

The admiral
23
Years of Service
User Offline
Joined: 29th Aug 2002
Location:
Posted: 9th Apr 2003 10:42
Thanks for that snippet malcom can i use in my game ill give u credits for that?? If I can I will be changing it a little bit and tweaking it slightly any how but id really like to use it in my game at least at this moment.

[href]www.vapournet.com/~flyer[/href]
The admiral
23
Years of Service
User Offline
Joined: 29th Aug 2002
Location:
Posted: 10th Apr 2003 07:57
???

[href]www.vapournet.com/~flyer[/href]
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 10th Apr 2003 11:27
Think about this slightly differently and you can use the normal mouse in an RTS game.

You are trying to find the mouses position in 3D space when there is no inbuilt command to do so. However there are commands that convert 3D space into 2D, so why not use those



I hope that helps

Pneumatic Dryll, Outrageous epic cleric of EQ/Xev
God made the world in 7 days, but we're still waiting for the patch.
UberTuba
23
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Brittania
Posted: 10th Apr 2003 19:08
there's a better way to do that, by splitting the screen in half
again and again, much quicker. Im doing an rts 2!!!

Life is a terminal disease.
You never survive it.

Login to post a reply

Server time is: 2026-07-12 00:07:06
Your offset time is: 2026-07-12 00:07:06