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.

Code Snippets / Create matrix Function... EASY FOR YOU

Author
Message
Dee
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: France
Posted: 12th Feb 2003 19:37
To create a matrix...

It's a function who need a picture in black and white... The white area are tall and black area are -... lol

you put it when you want to create the matrix :

charge_matrix(index of the matrix,SizeX,SizeZ,TileX,TileZ,texture,Type of texture,alpha,reduction)

EXPLICATION :

index of the matrix --> Is the n° of the matrix
SizeX --> Is the size on the X axe
SizeZ --> Is the size on the Z axe
TileX --> Is the number of Tiles on the X axe
TileZ --> Is the number of Tiles on the X axe
texture --> Is the texture of the matrix
Type of texture --> If this value = 1 then the texture is cuting to put on the tiles and create an only picture. If this value = 0 then the picture is repeat on all tiles.
alpha --> the picture who create the matrix
reduction --> you can reduce your matrix with this parameter. If it's big, the matrix is small...



You put it in the end of the code :

function charge_matrix(index#,X#,Y#,TilesX#,TilesY#,Image$,texturage#,alpha$,prop#)

load image Image$,index#
load image alpha$,index#+1000
load bitmap alpha$,index#+1000
paste image index#+1000,0,0

tailleX = Bitmap width(index#+1000)
tailleY = Bitmap height(index#+1000)
Delete bitmap index#+1000
load image alpha$,index#+1000
make matrix index#,X#,Y#,TilesX#,TilesY#

if texturage#=0 then prepare matrix texture index#,index#,1,1
if texturage#=1 then prepare matrix texture index#,index#,TilesX#,TilesY#

paste image index#+1000,0,0

FOR Tiles1=1 to TilesY#
FOR Tiles=1 to TilesX#

paste image index#+1000,0,0
hight# = ((rgbg(point(tailleX/TilesX#*Tiles,tailleY/TilesY#*Tiles1))+rgbb(point(tailleX/TilesX#*Tiles,tailleY/TilesY#*Tiles1))+rgbr(point(tailleX/TilesX#*Tiles,tailleY/TilesY#*Tiles1)))/prop#)
set matrix height index#,Tiles,Tiles1,hight#
set matrix texture index#,1,0
NEXT Tiles1
NEXT Tiles

if texturage#=1
iTile = 1
FOR Tiles1=1 to TilesY#
FOR Tiles=1 to TilesX#
set matrix tile index#,TilesX#-Tiles,Tiles1-1,iTile
inc iTile
NEXT Tiles
NEXT Tiles1
endif


UPDATE MATRIX 1

endfunction





Dee
---3Dee by me---

Login to post a reply

Server time is: 2024-05-05 05:26:48
Your offset time is: 2024-05-05 05:26:48