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

Collision Example added #96

Open
IonSwitz opened this issue Jan 28, 2014 · 4 comments
Open

Collision Example added #96

IonSwitz opened this issue Jan 28, 2014 · 4 comments

Comments

@IonSwitz
Copy link
Member

Our 10th Example is now the Collision example.

It illustrates precision Touch events, that is based on the geometry of objects, rather than merely boundingboxes.

It also works as a test benchmark for my new "Stroke vs Stroke" intersection test. This allows precision testing on line level, and will return an impact point for the user. There are improvements that can be made when it comes to speed, but so far, it makes for a quite fun little demo of what our beloved Graphics Extension can pull off.

@IonSwitz
Copy link
Member Author

I have extended Example 10 now to demonstrate how the user can get all the intersection points from a Stroke vs Stroke test.

The various shapes here (three stars, and one shape with an ellipse and a rect) are intersected and the intersection points are displayed as small colored NGon dots:

image

The dots also remain for 0.5 secods, which is why it looks like there are dots in odd places. In reality, all 4 Strokes rotate continously, creating an almost mesmerizing display of balls and shapes. :)

@AlBirdie
Copy link
Contributor

Nice! Happy to see it in the extension. Though I've done my own test for intersections I'll certainly try this to see what's faster once it get's a little more quiet around here.

@IonSwitz
Copy link
Member Author

The example can run slow because of the large number of NGons that are created as the colored balls. Uncomment that code for proper performance tests

@AlBirdie
Copy link
Contributor

I actually intend to test this with my use case, so I'll simply swap the routines and let two identical devices run our app to see what's what.
Not really a fan of synthetic benchmarks any more, given the very strange results of my tests last week. ;)

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