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 Professional Discussion / A little matrix texture help please

Author
Message
Pheagey
22
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Mid-Fl., USA
Posted: 28th Jan 2003 17:25
Ok, I'll adit Im a noob. (hanges head down).
So here's my problems. Iuse the following snippet to produce a matrix modified by a height map (gray BMP used for this). Next I'm trying to texture the whole matrix with 1 colored texture. But Im running into the problem of the texture only repeating on each tile. Any ideas?

thanx
Pheagey
22
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Mid-Fl., USA
Posted: 29th Jan 2003 00:51
bump

Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 29th Jan 2003 01:32
The matrix is textured with a tile of images. If you wanted to split a single image over the entire matrix:

1) Use PREPARE MATRIX TEXTURE yourmatrix,image,number of matrix tiles across, number of matrix tiles down

If the image is split up into as many tiles as there are tiles on the matrix (which is what the above code will do) - then you can texture each matrix tile with the corresponding tile from the texture tile.

to texture the matrix, use:

SET MATRIX TILE matrixno,matrix tile x, matrix tile z, image tile

For the image tile, only a single number is used to refernce them, and supposing you split your image up into four tiles, they would look like this:

_________________
¦Tile 1 ¦ Tile 2 ¦
------------------
¦Tile 3 ¦ Tile 4 ¦
------------------

NOBODY has a forum name as stupid as Darth Shader. I do.
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 29th Jan 2003 01:54
This code should do what you want (I am not sure that it is 100% correct though). The important bit is the For loops which iterate through and texture the tiles. You will need to reset the image names.



NOBODY has a forum name as stupid as Darth Shader. I do.
Pheagey
22
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Mid-Fl., USA
Posted: 29th Jan 2003 05:53
Thanks man. I'll let yea have a sneak peak at this before I release it. this helped alot. thanks again Darth Shader

Pheagey
22
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Mid-Fl., USA
Posted: 30th Jan 2003 16:46
Ok, here's what I have:



now when I do this:





or anything else to increase the texture resolution on the matrix I get a memblock out of range. How would I fix this?

Login to post a reply

Server time is: 2025-05-17 23:50:35
Your offset time is: 2025-05-17 23:50:35