Firstly… could we maybe get a thread prefix for molehill / GPU / 3D related threads?
Ok so I am working on my own Molehill 2D painting classes. I took a look at Ely Greenfield’s M2D stuff but I found it a tad overkill for what I am looking for. So I want to do my own. I have been working off of Polygonal’s example. You can check out my code here - http://j.mp/hI3wcj
Assume I want to paint one entity that is a rectangular bitmap image using two triangles (essentially a quad). Basically I am having a hard time understanding how to translate this:
bitmapData.copyPixels( sourceBitmapData, sourceRectangle, destinationPt.. );
to this (assuming I am using a x, y, u, v vector pairing):
vertexBuffer3D.uploadFromVector( Vector.<Number>([ .... ]), 0, 4 );
For when the sourceRectangle = sourceBitmapData.rect I use these vector values and it works as expected:
Vector.<Number>
([
0, 0, 0, 0,
1, 0, 1, 0,
1, 1, 1, 1,
0, 1, 0, 1
]);
Specifically if the source rectangle doesn’t contain the same values of the sourceBitmapData.rect. What if I want to paint only a portion of a bitmap onto a quad? Or stretch a portion of the image across a quad.