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.

3 Dimensional Chat / 3d space wierdness

Author
Message
qwe
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 16th Sep 2003 05:19 Edited at: 17th Sep 2003 00:58
i have a project named "learn" in which im learning about 3d
in it, I have a matrix 10,000 by 10,000
around the matrix i tried to make walls
my box objects are made and placed as follows:

(The box is 8000 long so they don't run into eachother. The size parameters enclose an 8000 by 8000 space on the matrix, and if your x or z value goes past 8000 your back to 8000, so you cannot go past the wall. wall, when viewed from inside world, should appear 1500 tall.)

make object box 1, 8000, 3000, 1000
position object 1, 4000, 1500, 500
make object box 2, 8000, 3000, 1000
position object 1, 4000, 1500, 9500
make object box 3, 1000, 3000, 8000
position object 3, 500, 1500, 4000
make object box 4, 1000, 3000, 8000
position object 4, 9500, 1500, 4000

mathematically, shouldn't it be perfect?
the problem is that at one corner, the walls run into eachother.
at the others, there is a gap.
and at some of the walls, you can go inside of it for a few feet till you are stopped.

is something wrong with my view of numbers or is DarkBASIC being wierd? I am on DBC btw.

P.S.
some walls are higher than others.
and am i correct in thinking that the coordinates you place an object will to be at exactly the middle of the object?

if so i probly just did the math wrong somewhere, tho i cant see how
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 16th Sep 2003 14:20
4th line down you are repositioning object 1. This line should be positioning object2 !!!! A Simple mistake!

If your mansion house needs haunting, just call Rentaghost!
qwe
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 17th Sep 2003 00:14
No that mistake was made when typing this into the forum, it is correct in the game
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 17th Sep 2003 00:34
OK, I'm at home now and can run your code. Just change all the 4000's to 5000.

If your mansion house needs haunting, just call Rentaghost!
qwe
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 17th Sep 2003 01:09
thanks that fixed most problems, but I can still walk through some walls a little bit (walls 2 and 4 i think)
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 17th Sep 2003 01:19
It all depends on what code you are using to move around your matrix and how you handle collision with the boxes. You have not provided any of this code and I am not a long-distance mindreader!

If you want help on this you are going to have to post some code.

If your mansion house needs haunting, just call Rentaghost!
qwe
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 17th Sep 2003 02:11 Edited at: 17th Sep 2003 02:13
note a lot is straight from the monster hunt tutorial
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 17th Sep 2003 03:52
Main problem is that 'position camera' command at the end. You do loads of calculations to work out camera pos, but then add 30 to x coord and 30 to z coord. You would therefore go through top and right walls.

Just change bottom section to:



You see I have given a 50 unit margin near the walls. This eliminates any futher danger of seeing through walls.

Another note: after doing a randomize matrix, you have to UPDATE MATRIX to see the effect. This is why you bob up and down whilst moving around matrix.

If your mansion house needs haunting, just call Rentaghost!

Login to post a reply

Server time is: 2025-06-26 23:08:27
Your offset time is: 2025-06-26 23:08:27