Download file -
WhatULookinAt.zip
The sample code demonstrates a method of determining what parts of a grid a user
is looking at using a field of view. I wrote this sample app because sometimes it's
just easier to be able to look at something in front of you and trouble shoot rather
then working with just a mental modal.
|
For example in the fallowing picture, the red circle represents the next position
that the player will move to. the green circle represents the players current position.
The light blue triangle represents the players FOV or field of view. The black triangles
represent what parts of the grid that will be draw as they are within the players
FOV.
|
 |
|
If we overlay a grid onto the play area we can see that grid indexes 2 to 5,7 to
10,12 to 14 are in the players visible range. So for example if this was a 3D application
we would only render objects that were inside previously mentioned grid areas.
|
 |