3D Pixel Art Generator
Hello! I have been creating a basic script that generates a 3D model from JSON data, pretty much it creates a lot of parts, and will color them and change the size depending on the data you enter. So you can get some cool stuff like this
Download: 3DPixelArt.rbxm (403.4 KB)
PLEASE CHECK THE SOLUTION FOR A WORKING HTML FILE
Honestly, there is a lot of possibilities with this project, you’re not limited to 2D pixel art, you can have it create any image you want.
The system is good for any small images, you can do any image you want though. The downside to large images is they take a while to build out. I’m sure this could be optimized a lot. The Charmander image is 128x128 pixels, which is the largest I would use.
The image uses getImageData() in JS for all the data. To get data, use the HTML code I provided inside the main script.
I provided more instructions using comments inside that file as well, and if you get confused feel free to leave a comment.
The code behind this is actually fairly simple, it pretty much runs a loop for every part it creates, and finds an RGB value from the data, each part has 4 channels of color: R(red)G(green)B(blue)A(alpha), I did not use alpha much except for fully transparent pixels as I am lazy. But you can change the code of this if you want to get semi-transparent pixels. You can honestly manipulate this is any way you want. Each image requires a module, modules are fairly simple to make and I provided a template.
Module Template
local module = {}
module.depth = 1
module.size = 32
module.data = [[DATA HERE]]
return module
Explanation:
module.depth
is the size on the Z coordinate, increasing this will make an image longer and more “3D”
module.size
is the width of the image, and height should be the same as width to make sure you have a square image.
module.data
is where you will copy/paste the data the HTML file gave you. This is usually a super long line, due to the fact that that each image has a lot of information.
Each pixel gets 4 values
Data Sizes
8x8: 256 values
16x16: 1024 values
32x32: 4096 values
64x64: 16384 values
128x128: 65536 values
Anyway, I can’t think of anything else to say, feel free to ask any questions you want.
Download: 3DPixelArt.rbxm (403.4 KB)