Skip to content

Implement PGraphicsOpenGL.getMatrix(PMatrix2D) (Issue #5063)#5826

Open
Romejanic wants to merge 2 commits intoprocessing:masterfrom
Romejanic:master
Open

Implement PGraphicsOpenGL.getMatrix(PMatrix2D) (Issue #5063)#5826
Romejanic wants to merge 2 commits intoprocessing:masterfrom
Romejanic:master

Conversation

@Romejanic
Copy link

@Romejanic Romejanic commented Mar 21, 2019

Hey there,

I implemented a currently unimplemented feature which is to store the current modelview matrix of a P2D sketch into a PMatrix2D object, so that it could be used elsewhere or applied later through applyMatrix().

Test code:

size(200,200,P2D);

translate(50,75);
rotate(0.2);
scale(random(0.5f,2f));
printMatrix();

PMatrix2D matrix = new PMatrix2D();
getMatrix(matrix);
matrix.print();

resetMatrix();
fill(255,0,0);
rect(50,50,50,50);

applyMatrix(matrix);
rect(50,50,50,50);

@Romejanic
Copy link
Author

Looks like this is never gonna be acknowledged lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant