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 / Can anyone tell me why I get "matrix coordinates illegal"

Author
Message
Guardian
22
Years of Service
User Offline
Joined: 30th Sep 2003
Location:
Posted: 26th Oct 2003 08:50
I've been trying to figure out why this code wont work. If anyone can tell me I'd really appreciate it.


make matrix 1,512,512,64,64
prepare matrix texture 1,1,64,64
for a=1 to 64 step 1
for b=1 to 64 step 1
for c=1 to 64 step 1
SET MATRIX TILE 1, a, b, c
next a
next b
next c
Scraggle
Moderator
23
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 26th Oct 2003 09:10
Two obvious things spring to mind.

1) 'step 1' is an unneccessary command. FOR...NEXT loops will automatically use a step value of one if you leave this command out. It won't cause any problems but it can save you some typing.

2) Each FOR...NEXT loop needs to be closed before the next is opened. So the three lines reading next a, next b, next c should be in the order c,b,a.
ReD_eYe
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 26th Oct 2003 09:27
for textures youy have to take 1 off the total matrix size as the coordinates are based on the bottom left hand corner
so do this



but what exactly are you trying to do?


Go on, click on my signature image, you know you want to
Favourite smiley>>>

Login to post a reply

Server time is: 2026-07-26 15:31:07
Your offset time is: 2026-07-26 15:31:07