对于围绕 x 轴的 pygame 绘图旋转,我有以下关键设置:
while done == False:
# ALL EVENT PROCESSING SHOULD GO BELOW THIS COMMENT
for event in pygame.event.get(): # User did something
if event.type == pygame.QUIT: # If user clicked close
done = True # Flag that we are done so we exit this loop
# User pressed down on a key
keys = pygame.key.get_pressed()
#X rotation clockwise
if keys[pygame.K_x]:
#rotate around the x axis
angle_y = angle_y+.1
if pygame.key.get_mods() & pygame.KMOD_LSHIFT:
#X rotation counterclockwise
if key[pygame.K_x]:
angle_y = angle_y+.1
我想按住 x 键,我的图像将围绕 x 轴顺时针旋转,然后我想按住左移和 x 键(或大写 X)并让图像逆时针旋转。
在我目前的设置下,即使我按住 shift,它也只会顺时针方向移动。