• Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at \$59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.

Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!

### #ActualNypyren

Posted 10 February 2014 - 11:19 PM

One alternative I can think of:

- Consider D to be a hinge.
- Place a new rect A'B'C'D' and point H' directly adjacent to DEFG and treat this as being a rotated version of ABCD.
- You now know the positions of both H' and H. Calculate the angle formed between them using D as the common vertex.
- Use that angle to rotate points A' through C' about D, back to their expected positions.

You could probably do this entirely with matrices and never actually measure an angle (I suspect), but I'm not good enough with linear algebra to verify that.

[attachment=19859:4vq7.png]

### #4Nypyren

Posted 10 February 2014 - 09:35 PM

One alternative I can think of:

- Consider D to be a hinge.
- Place a new rect A'B'C'D' and point H' directly adjacent to DEFG and treat this as being a rotated version of ABCD.
- You now know the positions of both H' and H. Calculate the angle formed between them using D as the common vertex.
- Use that angle to rotate points A' through C' about D, back to their expected positions.

You could probably do this entirely with matrices and never actually measure an angle (I suspect), but I'm not good enough with linear algebra to verify that.

### #3Nypyren

Posted 10 February 2014 - 09:35 PM

One alternative I can think of:

- Consider D to be a hinge.
- Place a new rect A'B'C'D' and point H' directly adjacent to DEFG and treat this as being a rotated version of ABCD.
- You now know the positions of both H' and H. Calculate the angle formed between them using D as the common vertex.
- Use that angle to rotate points A' through C' about D, back to their expected positions.

You could probably do this entirely with rotation matrices and never actually measure an angle (I suspect), but I'm not good enough with linear algebra to verify that.

### #2Nypyren

Posted 10 February 2014 - 09:29 PM

One alternative I can think of:

- Consider D to be a hinge.
- Place a new rect A'B'C'D' and point H' directly adjacent to DEFG and treat this as being a rotated version of ABCD.
- You now know the positions of both H' and H. Calculate the angle formed between them using D as the common vertex.
- Use that angle to rotate points A' through C' about D, back to their expected positions.

### #1Nypyren

Posted 10 February 2014 - 09:27 PM

One alternative I can think of:

- Consider D to be a hinge.
- Place a new rect A'B'C'D' and point H' directly adjacent to DEFG and treat this as being a pre-rotated version of ABCD.
- You now know the positions of both H' and H. Calculate the angle formed between them using D as the common vertex.
- Use that angle to rotate points A' through C' about D, back to their expected positions.

PARTNERS