-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shortcut notation for pushMatrix/popMatrix combo #237
Comments
agree that this would be good to have, and pretty easy to implement. I feel like |
matrixScope would work. Very technical though. How about "locally"?
how does that sound/read? |
There might be a chance of confusion with other things that have associated stacks that could be localised? edit: but it seems to read quite well on the face of it. |
indeed, Processing has 2 stacks (matrix and styles). On top of that, speaking about a hypothetic future, there could be something related to sound transforms, particles and palettes (particles and palettes have been tackled by cyrilcode.com and it'd be nice to take a look into that one day). How about we get |
Sounds sensible to me. |
So I think we can actually close this issue now can't we? This feature is fully implemented and working really well. Unless there's other stuff we'd like to do? |
I don't think we have a specific keyword yet for this specific thing I'm proposing. Yes we do have local transforms so we can achieve the same by saying:
but I don't think we have a more coincise way like with a specific keyword. (Or do we?) |
What about Reversing the order matrixPush or matrixPop that seems to make a bit more sense to me |
@Richard-Mineall that's an idea. Although this particular issue is about something else, it's about inventing one keyword that runs a block of code with particular transformations and isolates the code after from those transformations... as in the examples above... (welcome to github by the way) |
then how about Push and Pop, we could put it under a section in the demos and tutorials called Matrix |
Feel free to open another Github issue about that so we don't confuse two things in this thread... (I think maybe Matrix sounds too technical as a menu entry. I'd call it "transformations" maybe.) |
so I'm still not seeing why we might want keywords as well as having the block indentation. I think the keywords are also a bit tricky as we have block indentation working with colours as well, so any keywords chosen can't just be transformation specific. unless we have multiple keywords I guess... |
yeah we don't strictly need them for matrix transformations cause we can do:
although actually for other states (fills or strokes or strokeSizes) there is no equivalent... |
aaahhh hang on I see, so actually the issue with the above code is a lack of scoping for these things within the times loops. to be honest, that should be pretty easy to fix |
should we scope state within the times loops though? And is that the only case where this would be needed? |
I have two reasons against "times"-bound scoping.
|
that seems like fair reasoning not to do it. I think the issue then is just defining how we think it should work, and then making the languages work the same way. so, if we have
The expectation is that the peg would be rotated 4 times? |
correct. As a recap, if that's not desired, one can write:
or
or
|
that all makes sense to me. I guess my next inquiry would be how the following should work?
and
I quite like the idea of having a keyword that works with the block scoping, but will block scope everything, colours, line thickness, rotations and all. thoughts? |
So far we have two proposals to only scope the world matrix:
and I throw-in now:
We have no proposals for other aspects of the context like stroke size, stroke color, fill. maybe withMatrix is growing on me. It's technical (but this looks like a keyword not needed by beginners?) but at least is specific... |
instead of doing
we could use a special notation, something like the (with-state) of Fluxus
.
You'd think that this is never needed given we already expose matrix operations that are block-scoped (I thought so) but actually take this example (found looking at xinaesthete@a532582#diff-568408f5e3594dce731522f377b2ac5aR87
):
this is a case when such command would be useful.
Any suggestIons for the name? just 'pushMatrix'? Would that be confusing?
The text was updated successfully, but these errors were encountered: