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 / How do I texture the WHOLE matrix with an image?

Author
Message
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 6th Jul 2008 19:47
Hey guys!

The question is already in the title:How can I texture a matrix with the whole image?. When using prepare matrix texture you texture each grid with the image. But I wan`t to texture the matrix as if it were a plain.

This is what I`ve tried:





Please post some simple code like above!

Thanks in advance, TheComet

frugi
16
Years of Service
User Offline
Joined: 6th Jul 2008
Location:
Posted: 6th Jul 2008 22:21
hi
i would do it like this:

make matrix 1,1000,1000,1,1
prepare matrix texture 1,1,1,1 (the last two numbers tell the height and the weight of the tiles in your texture picture and you set them to 50( i dont think that you will use 2500 different textures))
set matrix tile 1,1,1,1

note you will need a 1000x1000 picture that it fits exactly to the matrix

frugi
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 7th Jul 2008 16:04
That`s a good suggestion, but I need more than one tile...

NanoGamez guy
18
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 7th Jul 2008 19:11
In the second code snippet, instead of:



use:



Where Maxx is the highest x can go and plus 1 because that start value is 0. So Maxx=50

OR

in the first code snippet, instead of:



use:



I swapped the x and the y for loops around because the texture is numbered from left to right. For example (in a 3x3 grid):




Did you know - 12% of Americans believe Joan of Arc was Noah's wife.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Jul 2008 23:39
@ NanoGamez guy

Thanks, that worked perfectly!

TheComet

Login to post a reply

Server time is: 2025-06-07 07:03:56
Your offset time is: 2025-06-07 07:03:56