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 / Texture on matrix

Author
Message
Dee
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: France
Posted: 12th Feb 2003 14:08
Hi,

I have a problem : I have and enormous picture (*.jpg) and I want put this picture on my matrix but when I do it, all the tiles have the same picture... I put a "set matrix tile" but it's badder !!! I have a lot a small pictures in my tiles... What is the code for my picture is complete on my matrix ???

Dee

P.S : Sorry for my bad english...
---3Dee by me---
---3Dee by me---
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 12th Feb 2003 16:01
something like this (I am not at my PC so it might not work) - this is not the exact code, just to give you an idea of what it should look like:

PREPARE MATRIX TEXTURE TILE matrixno,imageno,matrixtilesacross,matrixtilesdown

iZ=0
iX=0
iTile = 0

for iZ=0 to matrixtilesdown
for iX = 0 to matrixtilesacross
SET MATRIX TILE matrixno,iX,matrixtilesdown-iZ,iTile
inc iTile
next iX
next iZ

What this code does is to split your big image up into a number of tiles equal to the number of tiles in the matrix and then texture each matrix tile with the matching image tile.

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: 12th Feb 2003 16:02
^^ hmm, you might need to set iTile to start at 1, not 0, I can't remember. Also, you need to reset iTile to the initial value every time you use this code sequence.

NOBODY has a forum name as stupid as Darth Shader. I do.
Dee
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: France
Posted: 12th Feb 2003 17:30
YES !!!!

It's that !!! It's right !!! Thank you Darth Shader... You are a God !!!

Dee

---3Dee by me---
TogaMario
22
Years of Service
User Offline
Joined: 30th Jan 2003
Location:
Posted: 12th Feb 2003 19:00
Lol, it's on the Create... tab tutorials, but I've got a question to elaborate on that, I'm making a matrix editor for DBPro (if there's a good one out there already, stop me before I go too far) and I want to be able to change a specific tile out. I guess what I'm getting at here is, I can't figure out how to get the mouse to "paint" on a specific tile. I know I need a detection code, then a paint code. I have the paint code(in general), but the detection code i'm lost on. Thanks!

Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 12th Feb 2003 19:55
Mouse / OBJECT / MATRIX detection is a real bastard, but I know this code has been done.

I can't remember exactly who did it, but I know they live on the RGT forums: http://www.realgametools.net/forums

NOBODY has a forum name as stupid as Darth Shader. I do.

Login to post a reply

Server time is: 2025-05-19 05:59:43
Your offset time is: 2025-05-19 05:59:43