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 / Round Matrix....

Author
Message
Brisc
21
Years of Service
User Offline
Joined: 14th Feb 2004
Location:
Posted: 15th Feb 2004 01:27
I recently bought DB and am still waiting on it via US-mail.
Im wondering, meanwhile, if a matrix can be created to be round.
What i mean is, could one build a round world and have gravity in the center (earth). Or maybe shaped as a coke can so that one could travel all the way around?

possible? or no?

mike
Douglass
21
Years of Service
User Offline
Joined: 28th Aug 2003
Location:
Posted: 15th Feb 2004 01:38
you cant have a spherical matrix but you could create a sphere and using point object create the illusion of gravity

Brisc
21
Years of Service
User Offline
Joined: 14th Feb 2004
Location:
Posted: 15th Feb 2004 01:42 Edited at: 15th Feb 2004 01:43
Point object...
Ill go that direction when i get DB.

thanks


mike
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 15th Feb 2004 01:43
well a matrix,
if basically a flat terrain you can raise or lower points, and texture the different tiles, but you cannot mould it into a globe

to do this it will have to be a 3d model, then you can create basically anything

a matrix is basically used to create terrain easily, as you can return the height of any given point, so your player doesnt go through the ground,

you can make it round to an extent like an arch would be possible.

to simulate a planet eg a small one you can make the tiles repeat themselves once you travel so far across it, a good example is on the tank demo in db, as it is an infinitie level that keeps looping

Brisc
21
Years of Service
User Offline
Joined: 14th Feb 2004
Location:
Posted: 15th Feb 2004 01:48
cool ill give a look... when im a DB user.


mike
Douglass
21
Years of Service
User Offline
Joined: 28th Aug 2003
Location:
Posted: 15th Feb 2004 02:12 Edited at: 15th Feb 2004 02:13
i was really bored so i made some code to move a cube around a sphere


John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 15th Feb 2004 06:21
Its impossible to make a matrix into a sphere, you would have to use an object.


We need help! Email us! [email protected]
MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 15th Feb 2004 06:30
You might be able to bend a matrix by raising and lowering some of the points. Then, shift matrix commands might "fake" a spherical matrix.

Either way, you're better off making an object rather than using a sphere.



A book? I hate book. Book is stupid.
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 15th Feb 2004 12:25
@doug

that has some dbp commands in, and since this is the dbc board i assume hes talking aboout dbc?

anyways heres some dbc friendly code

Crappy Coder
21
Years of Service
User Offline
Joined: 16th Sep 2003
Location: Uk, Bath
Posted: 15th Feb 2004 16:24
to make a round (circular matrix) you could cheat... you make a matrix with width w and depth d and tiles in the x and z, tx and tz respectivley. you find the middle tile of the matrix, very easy and then in a for loop that goes through each matrix point.. like this

for x = 1 to tx
for z = 1 tz

next z
next x

you check the distance from the center to the current matrix point, if the distance is greate than the desired radius then you set the matrix height at this point at -100000 for example, this should give you a roundish matrix. The mores tiles you have the rounder it will become

then in the loop you just do the same distance check from the centre but use the player position instead of matrix tile, and restrict the movement when the distance is alsmost the same as the radius.. this will stop the player from falling of the edge and down the massive hill.

this wont be any good for a sphere... but if you are just after a matrix disc... this is a simple way of doing it
Crappy Coder
21
Years of Service
User Offline
Joined: 16th Sep 2003
Location: Uk, Bath
Posted: 15th Feb 2004 16:28
doug your code only works in dbpro... this is a dbc board... i was wondering why the commands wherent recognized

and also you code has similar porblems to mine that i tried to write a while ago.. this is that it messes up at the poles of the sphere.. yours also gets further away from the sphere each loop, mine also did this but i think i found a way round this...

it really isn't as easy as you first think, i was going to write a cool mini game that used a sphere for the terrain... you go around and land on planets.. but unfortunately i couldn't get it to work..
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 15th Feb 2004 22:04
Quote: "yours also gets further away from the sphere each loop"


i assume your talking about mine?

i dunno what you mean though :-P, it doesnt get further from the sphere when you loop it.

@crappy coder

on the tank2 demo that has the infinitie matrix routine, you could use that but make the matrix bigger and do your idea of lowering points to simulate the round planet, but you would have to 1st put all the matrix heights into an array and lower the points in relation to your position

Crappy Coder
21
Years of Service
User Offline
Joined: 16th Sep 2003
Location: Uk, Bath
Posted: 16th Feb 2004 04:34
yeah i was just talking about a circle floor, no planet shape... just a flat round disc

and its dougs code snippet... the cube gets slowly further and further away from the planet as you move it

Login to post a reply

Server time is: 2025-05-23 04:23:06
Your offset time is: 2025-05-23 04:23:06