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

Add support for Translate, Scale, Rotate against instances #20

Open
Codeglee opened this issue Apr 29, 2014 · 1 comment
Open

Add support for Translate, Scale, Rotate against instances #20

Codeglee opened this issue Apr 29, 2014 · 1 comment

Comments

@Codeglee
Copy link

It's a really nifty engine you've written. It would be a great candidate for small turn-based games. For that, we'd need to be able to capture the shape instances and move them rather than cloning them each time.

Is there any chance of that happening? I know that you're hoping to keep the scope small.

@jdan
Copy link
Owner

jdan commented Apr 29, 2014

The reason why shapes are cloned now is so you can declare shapes with one side, followed by that same slide transformed in various ways, i.e.

var face = new Path([ Point.ORIGIN, Point(1, 0, 0), Point(1, 0, 1), Point(0, 0, 1) ]);

var cubicle = new Shape([
  face,
  face.rotateZ(Point(0.5, 0.5), Math.PI / 2),
  face.rotateZ(Point(0.5, 0.5), Math.PI),
  face.rotateZ(Point(0.5, 0.5), 3 * Math.PI / 2)
]);

Same goes for paths built from translated points. For performance reasons, though, I definitely would like to explore changing a point/path/shape's properties instead of cloning. Not sure how I want the API to look exactly, though. But it is definitely something I'd like to incorporate.

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

No branches or pull requests

2 participants