Jump to content
  • Advertisement
Sign in to follow this  
EvilProgrammer

OpenGL Best way to do spheres

This topic is 5429 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

Quote:
Original post by mikeman
If it doesn't use the MV matrix for scaling, I suppose the vp would use a uniform variable as a scale factor. But that's not as flexible as using the matrix. Most times,the order of matrix operations is important. Or do you mean something else?

Yes, using uniform would be best solution. And also requires less data. You don't need normals as you generate them inside VP from position. What do you mean by order of matrix operations? It stays the same.

Share this post


Link to post
Share on other sites
Advertisement
...
glTranslatef(...)
glScalef(...)
...

is not the same as

...
glScalef(...)
glTranslatef(...)
...

How would you do that with a uniform?

I was talking of course for situations where you use glScale for things more complex than just make an object look larger, so I guess I was a little off topic. For just scaling a sphere, using a uniform would be a good choise.

Share this post


Link to post
Share on other sites
I know it's a difference. But I really don't see what's the problem here. What you do before drawing it not an isue here. It's gonna be the same if you use FFP or VP. The uniform I was thinking is just radius, not the whole matrix. You grab that from standard matrix stack.

Share this post


Link to post
Share on other sites
You're right, if you read my (edited) previous post you'll see I just misunderstood the whole thing a little. Just to increase the radius of a sphere, uniforms will do the trick.

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!