January 15, 2021, 06:24:12 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Forum
Help
Search
Gallery
Login
Register
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Graphics
»
[bb] Tile2Iso by pc_tek [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] Tile2Iso by pc_tek [ 1+ years ago ] (Read 405 times)
BlitzBot
Jr. Member
Posts: 1
[bb] Tile2Iso by pc_tek [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:41 AM »
Title :
Tile2Iso
Author :
pc_tek
Posted :
1+ years ago
Description :
Converts square tile to an Isometric image.
Code :
Code: BlitzBasic
; Author: JP Hamilton 2011
; Title: Tile2Iso.bb creates Isometric images from a uniform tile. Floor, Left & Right
; Inputs: 1 tile of equal sides (32x32, 64x64...etc)
; Outputs: 1 image containing the Isometric images
Graphics3D
640
,
480
,
32
,
2
filein$=
"image.png"
fileout$=
"slab1.bmp"
GFX_In=
LoadImage
(
filein$
)
GFX_Out=
CreateImage
(
ImageWidth
(
GFX_In
)
*
4
,
ImageHeight
(
GFX_In
)
+
ImageHeight
(
GFX_In
)
/
2
)
For
x=
0
To
ImageWidth
(
GFX_In
)
-
1
For
y=
0
To
ImageHeight
(
GFX_In
)
-
1
ix=x+y:iy=
ImageWidth
(
GFX_In
)
/
2
-
Int
(
x/
2
)
+y/
2
WritePixel
ix+
0
,iy,
ReadPixel
(
x,y,
ImageBuffer
(
GFX_In
)
)
WritePixel
ix+
1
,iy,
ReadPixel
(
x,y,
ImageBuffer
(
GFX_In
)
)
Next
Next
For
x=
0
To
ImageWidth
(
GFX_In
)
-
1
For
y=
0
To
ImageHeight
(
GFX_In
)
-
1
ix=x:iy=y+x/
2
WritePixel
ix+
ImageWidth
(
GFX_In
)
*
2
,iy+
1
,
ReadPixel
(
x,y,
ImageBuffer
(
GFX_In
)
)
Next
Next
For
x=
0
To
ImageWidth
(
GFX_In
)
-
1
For
y=
0
To
ImageHeight
(
GFX_In
)
-
1
ix=x:iy=
ImageWidth
(
GFX_In
)
/
2
-x/
2
+y
WritePixel
ix+
ImageWidth
(
GFX_In
)
*
3
,iy,
ReadPixel
(
x,y,
ImageBuffer
(
GFX_In
)
)
Next
Next
GrabImage
GFX_Out,
0
,
0
SaveImage
(
GFX_Out,fileout$
)
EndGraphics
End
Comments :
Andy_A(Posted 1+ years ago)
This could be useful to non-artist types like me. Nice!
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Graphics
»
[bb] Tile2Iso by pc_tek [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal