rakesh_thp
10-08-2009, 01:59 AM
Hello,
I have a huge amount of lat lon data.. and i store them in maps (C++ std::map).. Now if i want to display all these points, it takes lot of time to display as the number of points are more ( somewhere around 22483 or something).
Now once i load the data, then if i zoom in and out, again it takes some time, as the map is traversed again from beginning to end and displays all the points..
Hence i want to optimize my displaying technique.. One thing what i came across is the use of Display List in opengl.. I used it and i got what i desired.. But i'm not able to select a particular point..
In the main program i have a function called,
DisplayAllGLObjects(bool select)
In this function the following code is written:
if(m_sctter_list)
glCallList(m_scatter_list);
else
{
m_scatter_list = glGenLists(1);
glNewList( m_scatter_list, GL_COMPILE);
// code: for loop to traverse the list of points and display
for(std::map<unsigned int, EObjects *>::iterator it = scatterlist.begin(); it != scatterlist.end(); it++)
{
EObjects *ob = (*it).second;
ob->DisplayGLObject(select);
}
glEndList();
}
Inside the loop the object will execute its display commands (glVertex3f() commands.)
what change i have to do if i want to select an object and move it..?? i have written select function code.. I am using Render Mode as (GL_SELECT_MODE).. ANd using OpenGL technique to pick and object.. But since i started using Display lists, i'm unable to do so..
Is there any other technique to optimize my display technique other then Display Lists..?? Or using the display lists itself my task can be achieved..??
Thanks in advance..
I have a huge amount of lat lon data.. and i store them in maps (C++ std::map).. Now if i want to display all these points, it takes lot of time to display as the number of points are more ( somewhere around 22483 or something).
Now once i load the data, then if i zoom in and out, again it takes some time, as the map is traversed again from beginning to end and displays all the points..
Hence i want to optimize my displaying technique.. One thing what i came across is the use of Display List in opengl.. I used it and i got what i desired.. But i'm not able to select a particular point..
In the main program i have a function called,
DisplayAllGLObjects(bool select)
In this function the following code is written:
if(m_sctter_list)
glCallList(m_scatter_list);
else
{
m_scatter_list = glGenLists(1);
glNewList( m_scatter_list, GL_COMPILE);
// code: for loop to traverse the list of points and display
for(std::map<unsigned int, EObjects *>::iterator it = scatterlist.begin(); it != scatterlist.end(); it++)
{
EObjects *ob = (*it).second;
ob->DisplayGLObject(select);
}
glEndList();
}
Inside the loop the object will execute its display commands (glVertex3f() commands.)
what change i have to do if i want to select an object and move it..?? i have written select function code.. I am using Render Mode as (GL_SELECT_MODE).. ANd using OpenGL technique to pick and object.. But since i started using Display lists, i'm unable to do so..
Is there any other technique to optimize my display technique other then Display Lists..?? Or using the display lists itself my task can be achieved..??
Thanks in advance..