I'm doing HTML5 Canvas development and currently have a large viewport (on the left) and a map (on the right). Like this:
I need to show on the map what is currently being viewed in the left. And I'm at a lost on how to calculate this. This is how I want it to be:
I am manipulating the main viewport via a transformation matrix. like [1, 0, 0, 1, 0, 0]
This is decently common functionality in different games and apps. So I assume there are resources on how to do it. But I haven't been able to find any.