Browse Search Popular Register Upload Rules User list Login:
Search:
Point in polygon detection(winding number)

Image:
screenshot of the scene

Author: ezpz(fib)5

Group: Default

Filesize: 26.98 kB

Date added: 2023-06-15

Rating: 5

Downloads: 1113

Views: 352

Comments: 9

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.3

Tags:

Scene tag

I was interested in this because I wanted to find a way to render a lot of cubes without spawning a huge amount of polygons.

I looked up on google and it showed some methods.

Here is the winding number algorithm.

Hover mouse over the red polygons and they will turn green

The triangle on the side is if you want to see the data.
Last edited at 2023/06/15 08:21:49 by ezpz(fib)5
Please log in to rate this scene
edit
Similar scenes
Title: cyclogon 1
Rating: 5
Filesize: 15.06 kB
Downloads: 588
Comments: 0
Ratings: 1
Date added: 2017/07/27 10:08:40
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: cyclogon 2
Rating: 5
Filesize: 17.64 kB
Downloads: 523
Comments: 0
Ratings: 1
Date added: 2017/07/27 10:12:09
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: irreglaur cyclogon 1
Rating: 5
Filesize: 21.36 kB
Downloads: 418
Comments: 1
Ratings: 1
Date added: 2017/07/27 10:18:31
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Point height of the polygon surface
Rating: 5
Filesize: 39.3 kB
Downloads: 291
Comments: 0
Ratings: 1
Date added: 2021/03/08 03:22:55
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Mouse over polygon effect
Rating: 5
Filesize: 5.09 kB
Downloads: 1236
Comments: 2
Ratings: 1
Date added: 2012/12/11 12:58:30
Made with: Algodoo v2.0.2 Edu
Rating: rated 5
download
Title: Non-Symmetrical Polygon Generator V2
Rating: 5.375
Filesize: 55.61 kB
Downloads: 586
Comments: 8
Ratings: 2
Date added: 2017/01/09 22:07:45
Made with: Algodoo v2.1.0
Rating: rated 5.4
download
Responses to this scene
show list
Title: Point Is Inside Object Detector
Rating: 5.625
Filesize: 58.87 kB
Downloads: 473
Comments: 4
Ratings: 2
Date added: 2023/06/16 11:49:50
Made with: Algodoo v2.1.0
Rating: rated 5.6
download
amazing
ezpz -- I understand the concept of the winding number algorithm, but I don't understand how that slowly rotating blue circle is used in this scene. Please explain.

Also, I noticed that when I hover my cursor over the polygon in the lower-right section of that group of various polygons, the polygon turns green when my cursor enters that cut-out section where it isn't touching any part of the polygon. It that working correctly or is that a software bug?

Overall, nice work on the scene! :tup:
Thanks. The blue circle is the point and it's showing the winding number in the tile on the right.

That may because I used the cut tool on the polygons or maybe it could be because of the unnessesary surfaces, I'm not sure
On the bottom right polygon it does that for me too, it may be because it's kind of irregular.
Somewhere in my scene archives I have a scene that user kilinich created that explains how to detect all of the surfaces on different types of polygons. If I find it I'll point you to it. I think you will find it to be very useful.


MORE: I found it! Here is a link to it: Mouse over polygon effect
Last edited at 2023/06/16 00:56:01 by Xray
I don't understand how it works, but it probably works by checking if the mouse is over a hole which the script treats as a polygon or something.
There's a link in the scene description to the Algodoo forum where kilinich describes it and answers a few questions. You might get your questions answered there. He hasn't been here on Algobox for a long time and I don't know if he will ever be back. I do not understand it well enough to explain it to you, but I would bet that user s_noonan understands it. He's even smarter than I am (if you can believe it). So, if you ask him nicely he might help you to figure it out. Just leave a comment on any of his recent scenes and he will probably get back to you soon.
Last edited at 2023/06/16 04:16:11 by Xray
Kilinich uses the Ray casting algorithm. The first surface in polygon.surfaces is the outside surface. The other surfaces are holes.

It may make sense to find a radius to the farthest point on the polygon and store this value in the polygon. You only need to do that one time. After that, check to see if the polygon is in the bounding circle before you determine if the point is inside the polygon.

If you are doing polygons, you may as well do circles and boxes while you are at it.
Thank you, s_noonan!