PDA

View Full Version : about drawing spheres



stream
01-09-2009, 07:41 AM
hi everyone.

i am starter for opengl. i have a project.. its name is balls pyramid. http://www.3dpuzzles.nl/puzzles/ballspyramid/bollenpiramide.gif here is the pieces of my puzzle. how can i draw this 5 pieces? i dont have any idea. pieces must be movable with direction keys..

thanks..

_NK47
01-09-2009, 08:04 AM
"how can i draw this 5 pieces?"
build one instance of the sphere (vertex -index buffers) and render them with different transformation matrix (MODELVIEW). rotation is not important only the translation counts here (glTranslate). with this you displace the spheres where you want them. same with direction keys which is not an OpenGL issue. grab pressed keys in your application and adjust the values in glTranslate. you can use GLUT to draw spheres.

stream
01-09-2009, 09:35 AM
:) thank you but i have no idea for codes. do you have an example?

_NK47
01-09-2009, 10:44 AM
none. but google has plenty.

stream
01-10-2009, 02:55 PM
any link? i couldnt find any document about it

ZbuffeR
01-10-2009, 03:49 PM
Come on ...
http://www.opengl.org/sdk/docs/man/xhtml/gluSphere.xml