r/processing • u/garygnuoffnewzoorev • Sep 07 '23
Beginner help request Changing attributes of individual shapes/objects
Hi everyone, I’m drawing an abstract face and I want to rotate some of the ellipses on my face, I’m also trying to add a blend mode to a separate circle I drew, when I use the rotate or blend mode function it affects everything. I think this is a fundamental misunderstanding on my part. Can anyone explain why only the circle doesn’t have its blend mode changed. Do(can) I have multiple draw boxes? Thank you
1
Upvotes
4
u/Divitiacus Sep 07 '23
You can do transformations of single objects with pushMatrix()/popMatrix (). https://processing.org/reference/pushMatrix_.html
3
u/Simplyfire Sep 07 '23
Other than the amazing pushMatrix() / popMatrix() - the blendMode must be manually reset with blendMode(BLEND) when you're done playing with other blend modes, BLEND is the default mode.
2
u/MakutaProto Sep 07 '23
It's hard to say what exactly you should change without seeing your code but here's a pseudo code example that may help.
For a standard face+circle I assume your code would be something like this
for rotating shapes and blend modes you can change it to something like this
you have to reset the blend mode if you dont want everything drawn in that blend mode because processing loops your code every frame and without resetting the blend mode that change will carry over into future frames.