How to do 2D shadow casting in Java?

后端 未结 2 411
萌比男神i
萌比男神i 2020-12-04 00:21

I\'m currently trying to implement a 2D shadow casting method in Java by following this tutorial: http://ncase.me/sight-and-light/

I want to stick to Line2D and Poly

2条回答
  •  情深已故
    2020-12-04 01:06

    I adopted a different approach for my game: instead of determining the visible regions, I first define a circular region surrounding the viewpoint as visible and then I cut the non visible regions (the shadows).

    A short description of my approach is available here:

    http://cartridgeslot0.blogspot.com.es/2014/07/improving-shadowcaster-short-tutorial.html

    Also, you can find this approach combined with a tile map and a 2D camera here:

    http://cartridgeslot0.blogspot.com.es/2014/07/managing-2d-camera.html

提交回复
热议问题