Skip to content
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

Non-uniform scaling #67

Closed
ghost opened this issue Feb 10, 2014 · 2 comments
Closed

Non-uniform scaling #67

ghost opened this issue Feb 10, 2014 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Feb 10, 2014

The ability to scale objects non-uniformly would be a great addition, I believe this can be done by matrix transformations.

@jonobr1
Copy link
Owner

jonobr1 commented Feb 10, 2014

You can do something similar to this, but you have to handle the matrix on your own. e.g:

var x = 5, y = 10;
var poly = two.makePolygon(points);
poly._matrix.manual = true;  // We're gonna hijack the Two.Polygon's matrix
poly._matrix.scale(x, y);

There are also skewX, skewY, translate, rotate functions.

@ghost
Copy link
Author

ghost commented Feb 11, 2014

Thanks! Really good to know and thanks for the link.

@ghost ghost closed this as completed Feb 11, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant