Advertisement

Zooming problems

Started by January 10, 2004 07:51 AM
0 comments, last by BartDevriendt 21 years, 1 month ago
Hello, I hope someone will be able to help me out on this. The situation is as follows: I have a 2D world with map projections of real world data (radio beacons etc). All locations have a name. The user has to be able to zoom onto the map. But when this is done labels next to the points move away from the points. (Due to scaling). I first used no lists so everything had to be recalculated which was very consuming. Then I put everything in lists, but when I zoom now these lists need to be recompiled so the text keeps its position. Here is what I mean: Before zoom x Name After zoom without recalc: x Name After zoom with recalc: x Name I've been looking into the OpenGL API but I didn't find anything I think could be usefull. Does anyone have a solution to make this operation very quick ? Bart Devriendt [edited by - BartDevriendt on January 10, 2004 8:53:08 AM]
Use one display list for the objects and 1 for the labels, place the uppertop (or whatever is 0,0 in your game) of the labels at the bottom right of the object the're corresponding to, then simply draw these labels translated a tiny amount right and down, that should do it (this amount will be n/zoomfactor).

[edited by - Tree Penguin on January 10, 2004 2:48:35 PM]

This topic is closed to new replies.

Advertisement