Bug 1305 : applyMatrix with images
Last modified: 2010-06-05 03:16




Status:
RESOLVED
Resolution:
INVALID -
Priority:
P2
Severity:
normal

 

Reporter:
toucansam
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2009-08-15 23:42
the applyMatrix function does not transform and image. Used inside of an
pushMatrix call and with P3D.

Version 1.0.6, on MacOSX

Here's the snippet of code we use to draw the image. The applyMatrix
function has no effect.

g.pushMatrix();
g.translate(position.x, position.y);
Mat22 mat = transform.getTransform();
if (g.g instanceof PGraphics3D) {
g.applyMatrix( mat.col1.x, mat.col2.x, 0, 0,
mat.col1.y, mat.col2.y, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1);
} else {
g.applyMatrix(mat.col1.x, mat.col2.x, 0, mat.col1.y, mat.col2.y, 0);
}
g.rotate(-rotation);
g.scale( localScale);
g.translate(localOffset.x, localOffset.y);

g.image(image, -halfImageWidth, -halfImageHeight);
g.popMatrix();

Thanks,
Daniel
Additional Comment #1 From fry 2009-08-16 07:58
Can you please attach a sketch that shows the issue with that snippet? I'd
be surprised if applyMatrix() were actually broken--it's used internally.
Additional Comment #2 From fry 2010-06-05 03:16
no response, closing bug.