Jump to content
  • Advertisement
Sign in to follow this  
merlin74

OpenGL Manipulating large models with OpenGL

This topic is 4889 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All, I use opengl to load 3DS models and then rotated and translate it with mouse control. Some of these model are pretty big(~120K vertices), and I end up with very low frame rate(~2fps). Is there any way to accelerate this operation? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
We can be more helpful if you can tell us how you're rendering the objects. I'm guessing you are using immediate mode, and if that's the case you should look into displaylists, and/or VBOs. Anyother possibility is that you don't have opengl setup properly on your computer, and you're stuck with a software implementation of opengl (shouldn't be the case if other opengl programs run at a decent speed).

Share this post


Link to post
Share on other sites
I am sure my settings of opengl is correct because other GL programs run smoothly.

Here is my display function:

void display(void){
int l_index;

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // This clear the background color to dark blue
glMatrixMode(GL_MODELVIEW); // Modeling transformation
glLoadIdentity(); // Initialize the model matrix as identity



gluLookAt(x, y, z,
x + lx,y + ly,z + lz,
0.0f,1.0f,0.0f);
glTranslatef (-eye[0], -eye[1], -eye[2]);
glRotatef(rot[0], 1.0f, 0.0f, 0.0f);
glRotatef(rot[1], 0.0f, 1.0f, 0.0f);
glRotatef(rot[2], 0.0f, 0.0f, 1.0f);

model.draw3ds();

frame++;
time=glutGet(GLUT_ELAPSED_TIME);
if (time - timebase > 1000) {
fprintf(stderr,"FPS:%4.2f\n",frame*1000.0/(time-timebase));
sprintf(s,"FPS:%4.2f",frame*1000.0/(time-timebase));
timebase = time;
frame = 0;
}

glFlush(); // This force the execution of OpenGL commands
glutSwapBuffers();
}

Share this post


Link to post
Share on other sites
I think they are going to be identical. The VBO is used mostly for rendering dynamical objects ,where lists for statical.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!