From: Matthias B. <ba...@ir...> - 2005-11-21 15:13:57
|
Matthias Treitler wrote: > I am very sorry that i am posting again my test program, but i have a little > problem which i am dialing with the whole day! > I was inspired from tutorial2 and tutorial3 and i added in tutorial2 a block > which should be connected to the > ode.environment and with collision detection! But there is a little problem > with the coordinates and i don't know why! I suppose you are referring to the collisions being somewhat away from the black rectangle. Your simulation is fine, the problem is just that you're drawing the rectangle at the wrong position. The origin of the GeomBox is at the *center* of the box, but your visualization has the origin at the corner. You have to shift the positions and draw like this: pygame.draw.rect(srf, (0,0,0), (coord(x-l/2,y+h/2),(l * (WIDTH / 6), h * (HEIGHT / 4))), 0) - Matthias - |