I have been working on this script for months and am happy to publicly announce it is now ready for production. Click here to download the code.
I have been using DrawImage in my own projects for a few years now and was so amazed at how much it helped me to visualize 3D objects that I wanted to share it with the world. The library is now available on a public GitHub repository, and you can get the code there.
If you’re looking for a library with lots of images then I would suggest using DrawImage. With a few exceptions, DrawImage is used to create a texture from a given image. The advantage of using a library like this is that it is a lot more convenient to use than the manual approach of hand-creating a texture.
The image processing capabilities of drawimage are quite extensive. It takes as input a 2D image and outputs a texture. The texture you end up with is in the form of a 2D “cube” or “sphere.” The 3D structure can then be manipulated by scaling, rotation, and translation. For example, you can apply a texture to a 2D object, or create the illusion of a 3D object.
That’s a great tip. I had a question about using layers and paths as paths in layers, but a quick search of how drawimage works produced no useful results. It looks like this, but I haven’t used the library yet to find out.
To use drawimage, you take an image and create a texture from it. A texture is more like a texture cache than a image. It contains information about the pixels in the image (which also stores the intensity of each pixel) but does not have access to the actual pixels. So if you want to know the pixels of a given pixel in the image, you just have to access the texture cache.
There’s no such thing as a canvas. You create a canvas and draw a bunch of different shapes on it. Draw your best guess and guess that will be the rectangle you want to draw. Then draw a line and repeat the process until you find exactly the right one. You’ll get a few more lines, then you may have a nice number of lines to draw on.
The same goes for drawing from pixels using the graphics API. You can’t use the pixels directly because the graphics API can’t handle it. But you can draw to an image and do all your drawing on that image.