We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › Projection of rotating shapes.
Page Index Toggle Pages: 1
Projection of rotating shapes. (Read 1132 times)
Projection of rotating shapes.
Mar 2nd, 2010, 10:31am
 
Just another little sketch (my second). I was interested in plotting the "shadow" of a 2D-shape as a function of rotation.

ProjectionPlot

Re: Projection of rotating shapes.
Reply #1 - Mar 2nd, 2010, 10:47am
 
Interesting.

does it work for convex shapes or any shape at all?

have you or do you plan on releasing the source?
Re: Projection of rotating shapes.
Reply #2 - Mar 3rd, 2010, 1:25am
 
Hi, it does only work with straight lines for the vertices, as the algorithm is rather simple. For each rotation find the x-value of the left-most vertex and the right-most vertex, which - under the constraint of straight lines connecting the vertices - should give you the "maxium width" as if projected from top (or bottom).
If you're interested in the code, I can share it, but it was too messy at the moment to put it online right away. (All my projects "grow" and quite often unneccessary leftovers make it bigger than nieeded etc.)
Re: Projection of rotating shapes.
Reply #3 - Mar 3rd, 2010, 5:25am
 
I've put the code online at http://www.openprocessing.org/visuals/?visualID=8022 now.
Page Index Toggle Pages: 1