- Home /
Drawing a minimap - need an advice
Hello! So im trying to draw a minimap. Everything is good, exept of a size of a rect that showes camera view. So is there any way to draw a rect/texture,that has size equale to camera view?
Im having something like this for now.
A nice way of drawing a $$anonymous$$imap is to use a second camera in orthogonal view pointing downwards at the scene. You can set the target texture of that camera to some texture, then apply that texture to whatever the $$anonymous$$imap is.
For the rectangle, you can cast four rays from the viewing camera to the floor of your environment, one ray for each corner of the camera. You will get four points of collision. These points will be in world space, which you can convert to $$anonymous$$imap space using a few transforms. Then you would draw a polygon using those points on the $$anonymous$$imap.
Note that since you seem to be using a perspective view camera and your $$anonymous$$imap is orthogonal view, you may actually have a trapezoid ins$$anonymous$$d of a rectangle on your $$anonymous$$imap.
Your answer
Follow this Question
Related Questions
Mini Map Help 1 Answer
Partially Transparent Minimap Camera 2 Answers
Resizing minimap camera fails on first function call, but not following calls 2 Answers
2D Minimap with 3D Globe 0 Answers
Minimap with community edition 1 Answer