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.

Newcomers DBPro Corner / 3d point and click movement...

Author
Message
Pyromaniac
21
Years of Service
User Offline
Joined: 8th Jan 2003
Location: United Kingdom
Posted: 16th Jun 2003 21:40
Im currently trying to create a game movement system similar to that seen in 3d action RPG's such as Dungeon Seige. I have my camera setup working correctly, however i cannot figure out a way to produce "point and click" movement since the 2d mouse coords are different from the 3d coords in the field.

can anyone point me in the right direction to create a system such as this?

Thanks for the help ^_^
Screw the rules! What can I blow up???
Moggie100
22
Years of Service
User Offline
Joined: 15th Oct 2002
Location: Behind You...
Posted: 17th Jun 2003 02:33
Well, there are at least 2 ways of doing this Pyromaniac, you can do it in an object and sprite intensive way - or in a maths intensive way - there may be more. One way of doing it is to create a grid of plains or other such objects and for each object create a sprite that covers about 32x32 on the screen at 640x480 resolution or 64x64 on 800x600 positioned over each object, and hide the lot.
Then just use a mouse controlled sprite in conjunction with these to work out which sprite is being clicked on, then use that sprite number to work out which object its over, the you can use the 'object position' commands to work out where the object is in 3D to get your co'ords.

Or you can do it the maths way, I'm not sure who wrote this code, but it shows the maths way of getting a 3D position from a 2D mouse position - If you created this code please tell me!



Pyromaniac
21
Years of Service
User Offline
Joined: 8th Jan 2003
Location: United Kingdom
Posted: 17th Jun 2003 20:17
thanks, that code works well ^_^ but would you mind explaining it a little? I'm kinda a newbie to darkbasic (I've gone through the basic 'pong and pac man' stage but i still dont fully understand everything.

I think with this peice of code, its mostly the variable names that are confusing. Sure ax#=45 means something to someone...but what

thanks again ^_^

Screw the rules! What can I blow up???
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 17th Jun 2003 21:31
I've made a simple rts movement system with ships etc. ve put together an example.

You are the th person to view this signature.
Programmers don't die, they just Gosub without return....

Login to post a reply

Server time is: 2024-11-24 18:40:58
Your offset time is: 2024-11-24 18:40:58