[ODE] ode and glut

Hampus Soderstrom hampus at sxp.se
Thu Nov 23 07:37:28 MST 2006


Hi Basak,

You could put the physics loop and drawing in a glutIdleFunc.  
Something like this:

int main(){
	// more stuff
	glutIdleFunc(display);
	// more stuff
}

void display(void){

          dSpaceCollide (space,0,&nearCallback);
         dWorldStep (world,0.001);
         dJointGroupEmpty (contactgroup);

         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
         glLoadIdentity();

         gluLookAt(cameraAt[0], cameraAt[1], cameraAt[2],
                 lookAt[0], lookAt[1], lookAt[2],
                 cameraUp[0], cameraUp[1], cameraUp[2]);

         draw_all_ode_bodies();
         glutSwapBuffers();
}



Regards
Hampa
Toribash.com

On 23 Nov 2006, at 5:40 PM, Basak Alper wrote:

> Hi,
> I want to use ode in a project but I want to incorporate shaders to  
> illuminate and texture the objects.
> The easiest way for me is using glut.
> Does anyone know how to use ODE just as dynamics engine and exclude  
> drawstuff and windowing part from ODE? I don't have much time to  
> figure out and don't know how ODE's windowing works.
> Thanks,
> Basak
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode



More information about the ODE mailing list