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 / Terrain target

Author
Message
Juventus
22
Years of Service
User Offline
Joined: 22nd Apr 2003
Location: Australia
Posted: 29th May 2003 19:07
Anyone have any idea how to go about making an effective mouse controlled target that sticks to an active 3d plane.
"Yah-hah, evil spider woman! I have captured you by
the short rabbits and can now deliver you violently to
your gynecologist for a thorough extermination."
arras
22
Years of Service
User Offline
Joined: 3rd Feb 2003
Location: Slovakia
Posted: 30th May 2003 17:42
Explain more what you mean, I think I do not understant clearly what you want to know.

You want to make 3d cursor or pointer?
Juventus
22
Years of Service
User Offline
Joined: 22nd Apr 2003
Location: Australia
Posted: 4th Jun 2003 19:12
It's OK. I solved the problem myself. I wanted to create a mouse controlled cross-hair that sticks to the ground, showing where the impact point of a fired projectile would be.
It's all done now.

"Yah-hah, evil spider woman! I have captured you by
the short rabbits and can now deliver you violently to
your gynecologist for a thorough extermination."
Stevo
22
Years of Service
User Offline
Joined: 4th Oct 2002
Location:
Posted: 6th Jun 2003 05:14
can you post how to do that, or give a clue, one of my games I am trying to make is a sort of remake of a game called armour command.
the way the vehicles are moved is by clicking on the matrix and the vehicles go to that point
thanks

Juventus
22
Years of Service
User Offline
Joined: 22nd Apr 2003
Location: Australia
Posted: 1st Jul 2003 20:19 Edited at: 1st Jul 2003 20:22
Hey,
well it's been a while since your post. I was trawling through old topics and stumbled upon it. Have you gotten anywhere with your problem?

I don't think that my particular solution would be quite what you want.
You can check out a, now quite primitive, version of my game that utilises my method here:

http://www.geocities.com/jux_of_my_newt/AOTELP.htm

If it's anything like what you need I'll give you a look at the code. It's still a bit messy - might be some impetus to clean it up then.

Good luck!

http://www.geocities.com/jux_of_my_newt/
Furiousuk
22
Years of Service
User Offline
Joined: 10th Jan 2003
Location: United Kingdom
Posted: 1st Jul 2003 22:11
If you are using a matrix as your land then its main axes are the Z and X axes, with Y dictating height.
The simplest (but not the best) way is to fix the camera to a set orientation and have the mouse move an object on the screen. To do this, hide the mouse and set the object you want to use as your cursor to move in a positive direction along the Z axis when mousemovey() is positive and set the cursor to move in a positive direction along the X axis when mousemovex() is positive. Then by assigning the cursor's Y co-ord to the ground height (use get ground height() and add so much to it) you will have a visible target on the 'land'. When the mouse is clicked feed the cursor's co-ords into your path finding algorithm and your vehicle will move to its new position.

As I said, this method is not the best as the cursor will of course shrink and stretch as its distance from the camera changes. Also, your camera's orientation has to be fixed to escape complicated math.

The best way I believe, is to use a 'ray' system, whereby a 'ray' is sent into the frustrum and sends back the co-ords of where it collides with something. This is a little complicated and may involve huge programming changes for your program.
Stevo
22
Years of Service
User Offline
Joined: 4th Oct 2002
Location:
Posted: 5th Jul 2003 04:03
thanks Juventus, i had forgotten this post as well I did a bit more with the game But I had to leave it when I couldn't figure out how to do this. I'll have a look at your program,
Furious, thanks for that as well, I'll give it a go, I don't mind how good or bad it would be at the moment, as long as something happened.
I think this would be such a cool game though, you have your tanks & stuff and then you just click in the distance where you want them to go, and then you have the other army or army base on the other side of some hills. I also thought that if it was done as multiplayer you could have some spy vehicles, to send in, with cameras on them, so you could see the other person. I think you could get some good tactics that way as well.

Login to post a reply

Server time is: 2025-05-20 01:50:37
Your offset time is: 2025-05-20 01:50:37