Jump to content

  • Log In with Google      Sign In   
  • Create Account


GottiJay

Member Since 20 Jun 2011
Offline Last Active Sep 19 2011 10:31 AM

Posts I've Made

In Topic: new Opengl Window

29 July 2011 - 06:59 AM

I cannot say much about your problems since the description is quite vague and you're only showing small pieces of code. But whatever you do, you absolutely don't want to call glutMainLoop again after creating the window.



its a very long code....i omitted ones i thought were not necessary.... but if you still want me to put them ...just let me know...........
i still could not find ways of working around the problem...since its imperative for me to create the window only when the button is clicked....the keyboard response has become very slow that i have to wait over 20secs for it to respond......this only happens after the second window has been created an destroyed....on first run(ie when its just the first window running) the keyboard works just fine.

Problem Description
what i want to achieve is to run my program which then creates the first window....then click a run anmation button which has the buttoncallback8 to start the animation.....if i then press esc to close the second window i want to be able to continue using both mouse and key function on window1.....but so far all i can do is create and destroy the second window(the animation also runs when the button is clicked which is fine)...but after destroying the second window i cant use the first effectively as the keyboard response slows down tremendously ...i have to wait over 20sec......i think the problem might be from my approach but i cant find an alternative method that will give the results i want...........i hope my description was better

thanks for your help. 

In Topic: new Opengl Window

28 July 2011 - 02:01 AM

hi, i am still having problems with multiple windows.....when i destroy the second window by pressing the esc key it closes but then i cant use the keyboard function on the main window....please could you give me an idea how to fix that.......
i also noticed that when i click the button again to create the window after i have destroyed it ...it does not create

thank you..


void OnKeyAnimation(unsigned char key, int x, int y){
	
	if (key == 27){
		bool loadMast= false;
		bool loadReflector= false;
		bool loadReceiver= false;
		bool loadConnector= false;
		bool loadStand= false;
		glutDestroyWindow(window2);
				
		
		//exit(0);
	}
}

static void TheButtonCallback8()
{
	
	loadMast = true;
	loadReflector = true;
	loadReceiver = true;
	loadConnector = true;
	loadStand = true;	

	animate=true;
	
	if(window2==0){
		
   	window2 = glutCreateWindow("animation"); 
   	glutDisplayFunc(display2); 
   	glutReshapeFunc(animation_Reshape); 
   	glutIdleFunc(OnIdle1); 
   	
   	glutKeyboardFunc(OnKeyAnimation);
		glutMouseFunc(Mouse);
		glutMotionFunc(Motion);	
		InitGL();
		glutMainLoop();
		
   	
	}
	
	
	printf("Run Animation");
}

In Topic: Disappearing Models

27 July 2011 - 10:30 AM


Tried to do some simple animations which basically moves individual model from one position to the other...each of them enclosed in an animation function ....the problem i have is when one animation finishes the model related to that animation disappears...making way for the model in the next animation.....which is not exactly what i want...

what i want is for the first model to remain in its position while the second animation was running and the second and the first models remain in their position while the third model is running an so on...this is how my animation function looks

thanks for your help


You forgot to attach your code, can you try to post it again because it's hard to pin-point the problem without.
I was going to take some wild stabs in the dark but i came up with so many different possible problems i decided to just wait for the code :)




thanks Scorpie i'm just seeing your reply....i finally did fix it...i had some flagging issues which i resolved

thank you


In Topic: new Opengl Window

27 July 2011 - 04:21 AM

fixed it thanks very much just had to increase the delay for the first model....sorry for the bother


thanks for all your help

In Topic: new Opengl Window

27 July 2011 - 04:13 AM

fixed the model dispalying like shadows by basically just coping the part of the main to the call back.....dont know if its right but it seemed to work

the only problem i now is that....the first model in the animation seem to go further than its end position in the animation....dont know the cause of that



static void TheButtonCallback8()
{
	animate=true;
	loadMast = true;
	loadReflector = true;
	loadReceiver = true;
	loadConnector = true;
	loadStand = true;	
	
	if(window2==0){
		
       window2 = glutCreateWindow("animation"); 
   	glutDisplayFunc(display2); 
   	glutReshapeFunc(OnReshape); 
   	glutIdleFunc(OnIdle1); 
       
       glutKeyboardFunc(OnKey);
		glutSpecialFunc (keyboard_s);
		glutMouseFunc(Mouse);
		glutMotionFunc(Motion);	
		glutPassiveMotionFunc(MousePassiveMotion);
		InitGL();
		glutMainLoop();
       
	}
	
	
	printf("Run Animation");
}

PARTNERS