PDA

View Full Version : To swing a swing



savita
05-03-2011, 01:01 PM
hello sir , now i am doing a mini project for my 6th sem on opengl,
and i did my own project,, in my project i drawn one person standing
on a road, and beside him one swing is tightened to the tree, and i
want to swing that swing,, but i am getting only the swinging of that
swing and all pictures are disappearing,,, so i need help from you
such that i want to swing the swing only and all pictures should
constant....
please will you help me soon within two days i want,, kindly requesting you,,

savita
05-03-2011, 01:02 PM
hello sir , now i am doing a mini project for my 6th sem on opengl,
and i did my own project,, in my project i drawn one person standing
on a road, and beside him one swing is tightened to the tree, and i
want to swing that swing,, but i am getting only the swinging of that
swing and all pictures are disappearing,,, so i need help from you
such that i want to swing the swing only and all pictures should
constant....
please will you help me soon within two days i want,, kindly requesting you,,

Aleksandar
05-03-2011, 01:52 PM
Push model-view matrix on the stack, do the transformation, and then pop it up. Don't forget to reset model-view at the beginning of draw function.

savita
05-04-2011, 06:46 AM
first thanks for your reply,,,,
please can you explain me bit clearly,either with code or with example,,please

Aleksandar
05-04-2011, 08:41 AM
If you have an openGL course at this semester, you should remember this basic things.
Well, in short, if you are using fixed functionality just call glPushMatrix(), then do all transformations needed to display swing in a proper position, and then call glPopMatrix().

savita
05-04-2011, 11:44 AM
thanks,,, now i got the swinging of that swing in the display window, when i pressed the key to perform the swinging operation the swing is swinging but the swing is buffering and other function keys are not working.. till now i used glutSwapBuffers() and also glClear(GL_COLOR_BUFFER_BIT) But samething happening,, i tried lot to avoid that buffering or flickering but no use,,, please help me

savita
05-06-2011, 12:18 PM
please reply me soon

savita
05-07-2011, 01:32 PM
Sir,,how to stop buffering of that swing,,,till now i used glClear(GL_COLOR_BUFFER_BIT); and glutSwapBuffers
then also buffering is there so what to do,,,, please reply me soon

savita
05-07-2011, 01:35 PM
Sir,,how to stop buffering of that swing,,,till now i used glClear(GL_COLOR_BUFFER_BIT); and glutSwapBuffers
then also buffering is there so what to do,,,, please reply me soon

Aleksandar
05-07-2011, 03:07 PM
What buffering are you talking about?
If you are creating a 3D scene, activate depth test with glEnable(GL_DEPTH_TEST), and clear depth buffer before each drawing with glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT).

savita
05-08-2011, 04:36 AM
no it is not a 3d scene ,,its just a swing drawn using glVertex(GL_POLYGON); which is tightened to the tree,,, i done swinging of that swing its coming but it is buffring

Aleksandar
05-08-2011, 09:57 AM
Please, give better description, or attach a screen-shoot.

savita
05-08-2011, 12:45 PM
I got that swinging,,,sir now i want how to avoid flickering of an object drawn using glBegin(GL_POLYGON)