byronknoll / visibility-polygon-js Goto Github PK
View Code? Open in Web Editor NEWThis library can be used to construct a visibility polygon for a set of line segments.
Home Page: http://www.byronknoll.com/visibility.html
This library can be used to construct a visibility polygon for a set of line segments.
Home Page: http://www.byronknoll.com/visibility.html
ooo
Original issue reported on code.google.com by [email protected]
on 27 Dec 2013 at 11:33
Hi,
Congrats for the lib.
However source code does not contain comments on the algorithm used.
What are the goals of the following methods:
I understand that the vertices are traversed in the inverse clockwise order. However not how segments are selected or not.
Thank you for the clarification.
Is this possible? Place a second, third observer so that they do not overlap each other?
Hi Byron!
Can this library be translated to C# language?
Or maybe there is C# version exists?
thanks
Hi, thanks a lot for the code, i'm using it in my Phaser 3 project. You can test it here (beware, might be gpu intensive).
I would like to adapt this code to the game by making the player's visibility as a cone in front of the player. Given the player's rotation in deg/rad and a constant F field of view, how could we adapt the code so that the compute
method does return only the rays in front of the player and not the whole 360° ?
Thanks a lot again !
Is it possible to get the invisibility polygon? This could be used as a way to block invisible parts in a game, see this forum post
Theoretically it is possible to draw a "negative" polygon and have it be one single polygon by using the edges of the viewport to connect any seperate parts. So this can result in infinitely thin lines along the viewport edges but that's ok.
Any ideas on how to make such an algorithm?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.