Moving from a rotating sphere to a 2d rectange

Started by
4 comments, last by chippiejnr 15 years, 12 months ago
Hey guys, I'm clueless when it comes to this. I've got a sphere that rotates quite nicely, but now I'm after when the user hits a keyboard button that sphere stops rotating and flods out to become a 2d rectange. Any ideas?
Advertisement
Code please.
Stopping rotation is pretty easy, but "flods out to become a 2d rectange"..

:/
It's simple to convert the sphere to a rectangle. Use an editing software (3DS max or Blender) and export the keyframes. In your program, you just interpolate between keyframes to have a smooth animation.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Quote:Original post by chippiejnr
Hey guys,

I'm clueless when it comes to this. I've got a sphere that rotates quite nicely, but now I'm after when the user hits a keyboard button that sphere stops rotating and flods out to become a 2d rectange.

Any ideas?


You could use a shader to do this pretty easily (depending on what "flods out" means).
ok - I'm going to put this project on hold for now, whilst I get on without other work. I think its a little 'out of my depth' and I feel like i must read and learn more of the basics first.

But thanks for all your replies :-)

This topic is closed to new replies.

Advertisement