Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have an OpenGL code that currently draws several spheres at different locations. I generate the vertex buffer data (and normal data) myself. However, to simplify the code and increase efficiency, I am now trying to use gluSphere instead. The problem is that if I want to draw several spheres at different locations, I think I will need several different model matrices, and thus several different MVP matrices (because I am using OpenGL 4.3 and there is no glTranslate). But if I want to rotate the whole scene, I will need to rotate all of these model matrices, instead of just one as before. Is there a workaround for this? Is there a simple way to draw several different things with gluQuadrics objects at different locations?

share|improve this question
    
Don't switch to gluSphere. It's unlikely going to increase efficiency and it will only make the code more complex when you have non-GLU objects as well. –  msell Jul 9 at 19:04
    
@msell I see. But I'm still concerned that my code is somewhat inefficient. Is there any alternative solution, or should I just try fixing my own code? –  kevin james Jul 9 at 19:16
    
Take a look at instancing. –  msell Jul 10 at 4:43
    
If you are using polygonal spheres, also consider using impostors –  Fault Jul 10 at 19:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.