CreativeInquiry / PEmbroider

Embroidery Library for Processing
Other
458 stars 26 forks source link

Matrix transform issue, in #42

Closed golanlevin closed 4 years ago

golanlevin commented 4 years ago

Got a good one for you, @LingDong- I made an example based on this recursive tree by Dan Shiffman: https://processing.org/examples/tree.html This example is located in examples/gallery/PEmbroider_tree/PEmbroider_tree.pde.

When rendered with Processing, it looks like this:

Screen Shot 2020-06-20 at 12 09 50 AM

When rendered with PEmbroider (adding E. before all graphics calls), it looks like:

Screen Shot 2020-06-20 at 12 09 15 AM

Please debug?

LingDong- commented 4 years ago

@golanlevin Fixed: f98fce51c7f2fb18d4bcc45d81c85a0011aba81e

I always have a different point of view of how transformation matrix should be applied (than Processing, and probably rest of the world :P). I think transformation matrices should be left multiplied in order of how they're written. Processing thinks the reverse should be true. That's why the problematic screenshot looks so familiar that I recognized the issue immediately. Now fixed by flipping order of matrix multiplication.