PDA

View Full Version : Scaling and Text



Kenny
01-10-2004, 04:45 AM
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 ?

Kenny Moens

nexusone
01-10-2004, 06:21 AM
Just don't scale the names when you draw, keep two data list, one list for map data the other names. or maybe some data marker in the list to get the name data points to draw from.

Then do a simpe test to check which names are in view when zooming in and only draw them.

Kenny
01-10-2004, 10:54 AM
Well, the names aren't scaled, and recalculating the coordinates is too expensive...

I would like to use a zooming/scaling function of opengl that performs the zoom, currently i use display lists to save all opengl stuff in, once it is in those lists i don't touch them anymore until i start zooming then I recalculate the coordinates (which works), but i was looking for a faster solution that doesn't require me to recalculate the coordinates.

Thanks
Kenny

ZbuffeR
01-10-2004, 01:28 PM
Maybe try to have 2 Display lists, one with background stuff and other one with the names.
So, you can zoom both and translate in screen coordinates the DL containing the name (originaly on top of the locations).