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 / where an object is on the matrix

Author
Message
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 30th Dec 2003 08:35
i'll prolly figure out how after i press POST MESSAGE but here it goes anyways...

i need to know what matrix tile obj 1 is over.
Matrix 1 is located at 0,0,0
obj 1 is located at
obj1x = obj1x + mousemovex()
obj1z = obj1z - mousemovey()

Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 30th Dec 2003 09:53 Edited at: 30th Dec 2003 09:55
Didn't you ask this in one of the multiple threads you created over the past few weeks?

Anyhow, to do it, simply divide the matrix width by the amount of xtiles ( this will give you the width of each tile ) and the matrix height by the amount of ztiles ( this will give you the length of each tile ).

Then, get the object's X position, and divide it by the width of the tiles, and do the same for the Z position, and voila, you should have the tile number...

eg:


Hope I Helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 30th Dec 2003 21:26
Quote: "Didn't you ask this in one of the multiple threads you created over the past few weeks?"

no, but i did post it a few months ago, but i couldnt find my post or the other program i had to do this in. i'll bookmark it this time

thanx JT, i knew you had to divide something by something and then do it again, blah blah blah...but now i know exactly how to do it...thanx much.

Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 31st Dec 2003 04:27
It's cool.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy

Login to post a reply

Server time is: 2025-06-07 02:53:36
Your offset time is: 2025-06-07 02:53:36