How to setup a minimap in Blender 2.55 - Video

Hi Blenderartists. I made a short video on how to make a simple minimap.
Just wanted to share that, in case someone needs it.

Video and files.

Really nice.

For a minimap i would set the z coordinate to 0 (i want a minimap di be flat).

Furthermore, i would also change the line

object_list[mini_object_name].position = (object_list[real_name].position[0] * map_scale + map_x,object_list[real_name].position[1] * map_scale + map_y,object_list[real_name].position[2] * map_scale + map_z)

with

object_list[mini_object_name].position = ((object_list[real_name].position[0] -relative_centre.worldPosition[0])* map_scale + map_x,(object_list[real_name].position[1] -relative_centre.worldPosition[1])* map_scale + map_y,(object_list[real_name].position[2] -relative_centre.worldPosition[3])* map_scale + map_z)

Because the centre of the minimap in your script is the centre of the blender space(0,0,0), but with this modification the centre of your minimap may refers to whatever(e.g. your moving player)

And you should change .position with .worldPosition instead. See the new api :wink:

I will study the new API more, and thanks for the feedback.
My script is actually moving the objects relative to the position of the map so i don’t know why the modification.
And about the z axis, i agree that it is useless for 2d minimaps.

This was my first “how to” video, if you have any requests for my next one just let me know. And please keep it simple until i warm up :wink:
Bye

A bit of maths.

If the circumference equation where the centre is in the origin is x^2+y^2=r, if you want the centre to be in another position, you must use (x-x1)^2+(y-y1)^2=r.
so…

In your script, the minimap centre represent the centre of the blender space.
If you add my modification, the centre of the map will represent an object in the blender space.

Example:
A minimap where the centre is you player(and i quite all the game the minimap works like that)

With your script, you would add an object player that moves in the map, while maybe someone would it to be centred in the minimap.

I can’t explain better what i mean…

(object_list[real_name].position[0] -relative_centre.worldPosition[0])* map_scale + map_x

object_list[real_name].worldPosition[0] = the position of the object relative to 0,0,0
map_scale = transform in scale of the map
map_x = the coordinate of the minimap(so if you move it, the object’ll follow it)
relative_centre.worldPosition[0]= adding this, you’ll use the position of the object relative to another object, not to 0,0,0

I’m not here to force anyone, if you don’t like my suggestion, simply don’t use it :wink:
If you want to better understand, try it :smiley:
Btw, nice vid as a first tutorial!!

Thank you again for your reply. I understand now what are you talking about.
I will make another minimap setup, with your modification. Should be on my blog by the end of this week.
Do you have any suggestions for my next video. There are almost no BGE tutorials so I want to make some.