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 / Need help urgently with a matrix

Author
Message
dazzling dazzla
20
Years of Service
User Offline
Joined: 6th Nov 2004
Location: here
Posted: 27th Dec 2004 23:17
Hi all

Ive been programming with dbc for a while and and have been stuck in a rut recently trying to create my own matrices. I want to texture the indivual tiles of the matrix rather than the whole thing but as I am not fully experienced I dont have too much of a clue and was wandering if you could tell me how to. I do know your supposed to use the set matrix tile command but i dont know how to . please help as i will be very greatful for any tiny bits of help!

the answer to all lives questions is...
... meh!
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 28th Dec 2004 04:09
I just posted this somewhere else but it might help you:


Realms Of Tutopia: Rise Of Evil
http://www.freewebs.com/elbsoftware/index.htm
dazzling dazzla
20
Years of Service
User Offline
Joined: 6th Nov 2004
Location: here
Posted: 28th Dec 2004 04:15
I was going to write about how I managed to work out how to do it using some simple commands but your reply is so briliant I think im gonna have to sit down for a while and work it out. Thank you ever so much!

the answer to all lives questions is...
... meh!
dazzling dazzla
20
Years of Service
User Offline
Joined: 6th Nov 2004
Location: here
Posted: 28th Dec 2004 04:25
Oh and here is what i used to solve my problem


For the benefit of the noobs, anyone viewing this code should go over it untill they understand it thoroughly. The reason I wanted to learn this is so that I could make a custom matrix without using things like matedit.

the answer to all lives questions is...
... meh!
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 29th Dec 2004 05:33
Oh, in case you didn't know 'set matrix height MatrixID,XPoint,ZPoint,Height'.

Realms Of Tutopia: Rise Of Evil
http://www.freewebs.com/elbsoftware/index.htm
dazzling dazzla
20
Years of Service
User Offline
Joined: 6th Nov 2004
Location: here
Posted: 29th Dec 2004 20:32
cheers mate! i also found a helpful tutorial/presentation designed by university lecturers on how to manipulate your own matrix. go to google and type in "dark basic tutorial set matrix tile command" and the first result you get gives you this download. alternatively go to "www.evl.uic.edu/spiff/class/cs426/ projects/fall2003/Syzware/download/MatrixDemo.ppt" for the same thing!

the answer to all lives questions is...
... meh!
chuckakan
20
Years of Service
User Offline
Joined: 2nd Feb 2005
Location:
Posted: 2nd Mar 2005 22:02
i would like to texture some mountains in my background a diffrent texture to the rest how would i go about thiatous. I have tried the trial but the matrix was black.

How do i put diffrent textures on diffrent parts of the same matrix?

thanks
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 2nd Mar 2005 22:53
to texture a matrix you need to load an image using the 'load image' command.
next you make the matrix using the 'make matrix' command.

to texture the matrix you write: prepare matrix texture matrix_nr, image_nr, image_x_tiles, image_y_tiles

here is code:


you want different textures on the matrix eh?
thats easy:

you load the image with.. say 3 textures: grass, mud and rock.
then you make the matrix.

now we texture the matrix BUT we tell db we want 3 different textures on the matrix (actually 4 textures but nr4 is never used)

prepare matrix texture 1, 1, 2, 2

we have a 2x2 tiled image (guess i should have mentioned that above) with 3 textures. uhh, i dont know how to explain but ask for help if you dont understand how the image should look like.

now you have textured the matrix with the FIRST tile in the image

to texture the rest of the matrix with other images you use the 'set matrix tile' command.

like this: set matrix tile matrix_nr, X_segment, Y_segment, tile_nr

remember we have 4 tiles in the image?

now to texture the matrix with random tiles here is code:


dazzling dazzla
20
Years of Service
User Offline
Joined: 6th Nov 2004
Location: here
Posted: 12th Mar 2005 23:45
Just to give a little piece of extra help to all:

You can only use One image to texture a matrix. You can however divide the matrix up and set different areas of the image for use on different sections. (Download the powerpoint presentation from the link given in my earlier post to clear this up). I might put a tutorial in the code base

the answer to all lives questions is...
... meh!

Login to post a reply

Server time is: 2025-05-23 18:59:18
Your offset time is: 2025-05-23 18:59:18