Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualIndignant

Posted 06 December 2012 - 07:53 AM

Hello Bacterius!

Thanks for your prompt reply. It is very helpful. I will take a closer look at the Bullet and ask when I have new questions. Thanks!

I have a few more questions though:


1)Where should I init the physics engine?

2)Where and how to make the main loop(which is supposed to be excecuted every frame, processe user input, call the phisics engine to update position and speed of objects, and call graphics engine to post redisplay, right?)

3)Should I instantiate objects in game(eg. the ball class mentioned above) in the following main function?
[source lang="cpp"]int main(int argc, char *argv[]){ glutInit(&argc, argv); glutInitWindowSize(640,480); glutInitWindowPosition(10,10); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); glutCreateWindow("GLUT Shapes"); glutReshapeFunc(resize); glutDisplayFunc(display); glutKeyboardFunc(key); glutIdleFunc(idle); glClearColor(1,1,1,1); glEnable(GL_CULL_FACE); glCullFace(GL_BACK); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); glEnable(GL_LIGHT0); glEnable(GL_NORMALIZE); glEnable(GL_COLOR_MATERIAL); glEnable(GL_LIGHTING); glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); glLightfv(GL_LIGHT0, GL_POSITION, light_position); glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess); glutMainLoop(); return EXIT_SUCCESS;}[/source]

4) How can I pass object to physics engine and read it back? (I know this questions is too broad, but if you know any good tutorial/documentations please let me know. Thanks a ton!)


Your reply would be much appreciated!

Best regards,

Indignant

#4Indignant

Posted 06 December 2012 - 07:52 AM

Hello Bacterius!

I really appreciate you reply. It is very helpful. I will take a closer look at the Bullet and ask when I have new questions. Thanks!

I have a few more questions though:


1)Where should I init the physics engine?

2)Where and how to make the main loop(which is supposed to be excecuted every frame, processe user input, call the phisics engine to update position and speed of objects, and call graphics engine to post redisplay, right?)

3)Should I instantiate objects in game(eg. the ball class mentioned above) in the following main function?
[source lang="cpp"]int main(int argc, char *argv[]){ glutInit(&argc, argv); glutInitWindowSize(640,480); glutInitWindowPosition(10,10); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); glutCreateWindow("GLUT Shapes"); glutReshapeFunc(resize); glutDisplayFunc(display); glutKeyboardFunc(key); glutIdleFunc(idle); glClearColor(1,1,1,1); glEnable(GL_CULL_FACE); glCullFace(GL_BACK); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); glEnable(GL_LIGHT0); glEnable(GL_NORMALIZE); glEnable(GL_COLOR_MATERIAL); glEnable(GL_LIGHTING); glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); glLightfv(GL_LIGHT0, GL_POSITION, light_position); glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess); glutMainLoop(); return EXIT_SUCCESS;}[/source]

4) How can I pass object to physics engine and read it back? (I know this questions is too broad, but if you know any good tutorial/documentations please let me know. Thanks a ton!)


Your reply would be much appreciated!

Best regards,

Indignant

#3Indignant

Posted 06 December 2012 - 07:48 AM

Hello Bacterius!

I really appreciate you reply. It is very helpful.

I have a few more questions though:


1)Where should I init the physics engine?

2)Where and how to make the main loop(which is supposed to be excecuted every frame, processe user input, call the phisics engine to update position and speed of objects, and call graphics engine to post redisplay, right?)

3)Should I instantiate objects in game(eg. the ball class mentioned above) in the following main function?
[source lang="cpp"]int main(int argc, char *argv[]){ glutInit(&argc, argv); glutInitWindowSize(640,480); glutInitWindowPosition(10,10); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); glutCreateWindow("GLUT Shapes"); glutReshapeFunc(resize); glutDisplayFunc(display); glutKeyboardFunc(key); glutIdleFunc(idle); glClearColor(1,1,1,1); glEnable(GL_CULL_FACE); glCullFace(GL_BACK); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); glEnable(GL_LIGHT0); glEnable(GL_NORMALIZE); glEnable(GL_COLOR_MATERIAL); glEnable(GL_LIGHTING); glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); glLightfv(GL_LIGHT0, GL_POSITION, light_position); glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess); glutMainLoop(); return EXIT_SUCCESS;}[/source]


Your reply would be much appreciated!

Best regards,

Indignant

#2Indignant

Posted 06 December 2012 - 07:46 AM

Hello Bacterius!

I really appreciate you reply. It is very helpful.

I have one more question though:

In the following main function, where should I instantiate objects in game(rg. the ball class mentioned above)?
And where should I init the physics engine? Where and how to make the main loop(which is supposed to be excecuted every frame, processe user input, call the phisics engine to update position and speed of objects, and call graphics engine to post redisplay, right?)
[source lang="cpp"]int main(int argc, char *argv[]){ glutInit(&argc, argv); glutInitWindowSize(640,480); glutInitWindowPosition(10,10); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); glutCreateWindow("GLUT Shapes"); glutReshapeFunc(resize); glutDisplayFunc(display); glutKeyboardFunc(key); glutIdleFunc(idle); glClearColor(1,1,1,1); glEnable(GL_CULL_FACE); glCullFace(GL_BACK); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); glEnable(GL_LIGHT0); glEnable(GL_NORMALIZE); glEnable(GL_COLOR_MATERIAL); glEnable(GL_LIGHTING); glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); glLightfv(GL_LIGHT0, GL_POSITION, light_position); glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess); glutMainLoop(); return EXIT_SUCCESS;}[/source]


Your reply would be much appreciated!

Best regards,

Indignant

#1Indignant

Posted 06 December 2012 - 07:45 AM

Hello Bacterius!

I really appreciate you reply. It is very helpful.

I have one more question though:

In the following main function, where should I instantiate objects in game(rg. the ball class mentioned above)?
And where should I init the physics engine? Where and how to make the main loop(which is supposed to be excecuted every frame, processe user input, call the phisics engine to update position and speed of objects, and call graphics engine to post redisplay, right?)
[source lang="cpp"]int main(int argc, char *argv[]){ glutInit(&argc, argv); glutInitWindowSize(640,480); glutInitWindowPosition(10,10); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); glutCreateWindow("GLUT Shapes"); glutReshapeFunc(resize); glutDisplayFunc(display); glutKeyboardFunc(key); glutIdleFunc(idle); glClearColor(1,1,1,1); glEnable(GL_CULL_FACE); glCullFace(GL_BACK); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); glEnable(GL_LIGHT0); glEnable(GL_NORMALIZE); glEnable(GL_COLOR_MATERIAL); glEnable(GL_LIGHTING); glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); glLightfv(GL_LIGHT0, GL_POSITION, light_position); glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess); glutMainLoop(); return EXIT_SUCCESS;}[/source]

PARTNERS