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.

Newcomers DBPro Corner / How do i texture a whole matrix with just 1 texture?

Author
Message
Kale
17
Years of Service
User Offline
Joined: 8th Sep 2002
Location: United Kingdom
Posted: 18th Sep 2002 00:44
this is my code:


TILE_SIZE = 50
MATRIX_SIZE_X = 500
MATRIX_SIZE_Z = 500

make matrix 1,MATRIX_SIZE_X,MATRIX_SIZE_Z,TILE_SIZE,TILE_SIZE
position matrix 1,0,0,0

`set matrix 1,1,1,1,2,1,1,1
prepare matrix texture 1,1,TILE_SIZE,TILE_SIZE

tile=0
for z=0 to TILE_SIZE step 1
for x=0 to TILE_SIZE step 1
set matrix tile 1,x,z,tile+1
inc tile,1
next x
next z
update matrix 1


image 1 is an image 250x250 pixels wide and i wanna texture the whole matrix with just one big image, any pointers to what is going wrong? it says matrix coords are out, i got this working in db but i must be tired, ive now tried for 2 hrs to sort it, grrrr. any ideas?
What the flame does not consume, consumes the flame.
----------------------------------------------------------------
AMD XP2100+, Geforce4Ti 4400, 512Mb DDR, Abit KX7.
xtom
17
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Ireland
Posted: 18th Sep 2002 02:56
Maybe it's this

for z=0 to TILE_SIZE-1
for x=0 to TILE_SIZE-1
Kale
17
Years of Service
User Offline
Joined: 8th Sep 2002
Location: United Kingdom
Posted: 18th Sep 2002 21:47


this code totally doesn't work any help will be most welcome?

What the flame does not consume, consumes the flame.
----------------------------------------------------------------
AMD XP2100+, Geforce4Ti 4400, 512Mb DDR, Abit KX7.
Scorpyo
17
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 19th Sep 2002 01:22
make your matrix 1 single tile (500x500 i guess) and grab the full jpg with get image:

make matrix 1,500,500,1,1
get image 1,0,0,250,250
prepare matrix texture 1,1,1,1

Kale
17
Years of Service
User Offline
Joined: 8th Sep 2002
Location: United Kingdom
Posted: 19th Sep 2002 20:26


he he.. i could do that but you miss the point, i need to terraform the matrix i.e. i wanna create a rocky landscape. The above code works in DB v1.13 but not in DBPro, there is a bug in the 'prepare matrix texture' command which is not tiling the sections correctly. ta anyway tho'

What the flame does not consume, consumes the flame.
----------------------------------------------------------------
AMD XP2100+, Geforce4Ti 4400, 512Mb DDR, Abit KX7.
Avan Madisen
17
Years of Service
User Offline
Joined: 12th Sep 2002
Location: The Castle Anthrax
Posted: 20th Sep 2002 02:41
Just a thought here but have you tried taking the for to loops from 1 rather then 0? It's possible that DBPro starts at 1 when DBV1 started at 0, just an illogical thought there but it's so crazy it might work!

If that fails, have a look at the examples in the matrix help files, there're two there, a showcase and a usage, one of them (probably the showcase) has two matrices flowing like the surface of water with a texture spread across them. The source there might be worth checking out.

Avan

You may scream when I get back...
Kale
17
Years of Service
User Offline
Joined: 8th Sep 2002
Location: United Kingdom
Posted: 20th Sep 2002 23:12
i have found the answer, it is a bug, see:

http://www.darkbasicpro.com/apollo/view.php?t=311&b=1

What the flame does not consume, consumes the flame.
----------------------------------------------------------------
AMD XP2100+, Geforce4Ti 4400, 512Mb DDR, Abit KX7.
GCEclipse
17
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: United Kingdom
Posted: 24th Sep 2002 17:35
Why not try this with the TERRAIN (I think)commands in the WORLD command set instead - the same commands don't work as those for matrixes but it seems a fairly good way to make a large landscape?

Apologies if I've got the names wrong here - but I don't have access to the manuals at the moment. There is definitely an alternative set of commands which enable you to do what you want.

Kale
17
Years of Service
User Offline
Joined: 8th Sep 2002
Location: United Kingdom
Posted: 24th Sep 2002 20:53
yes i've seen the terrain commands but they dont yet(?) give commands to texture 1 tile at a time

What the flame does not consume, consumes the flame.
----------------------------------------------------------------
AMD XP2100+, Geforce4Ti 4400, 512Mb DDR, Abit KX7.

Login to post a reply

Server time is: 2020-01-29 07:28:12
Your offset time is: 2020-01-29 07:28:12