Creating a moving car

Hey, im new here so sorry if i missed some old post or something, it tried looking it up but couldn’t find anything that was of any help.

Basically what i have a is a Box (just a test box, later will model the actual car) and i need to move it in the x,y plane.

Basically what i did was:

	glRotatef(angle, axis_x, axis_y, axis_z);
	glTranslatef(_position[0],_position[1],0);
	micro_car_draw(_size);

_position is a vector with the x,y values stored in the first and second position respectivelly and the car is suposed to move around the z axis, placed in the back of the Box (where the back wheels are going to be placed).

The thing is, i can only either move the car along the world x axis while rotating on itself, or to move the car along its its own x axis but centered on the world origin instead.

Any input will be apreciated, thanks.

It’s all about how you are updating the axis and position values. Can you tell a little bit about how you’re doing this?