Rotate 3D image batches to make them 2D

你。 提交于 2019-12-13 17:21:34

问题


My on_draw function is:

def on_draw(self):
    self.clear()
    self.set3d()
    glPushMatrix()
    glRotatef(-rot[0], 1, 0, 0)
    glRotatef(-rot[1], 0, 1, 0)
    glTranslatef(-pos[0],-pos[1],-pos[2],)
    self.model.draw()
    glPopMatrix()

pos (position) and rot (rotation) are lists of camera information used to transform the graphics. What I want to achieve is a doom-like effect where the images (certain parts of the scenery, players, enemy images) are kept so that they are parallel to the screen; they stay 2D, regardless of their position in relation to the camera. Note that they should still move around with the rest of the 3D graphics.

来源:https://stackoverflow.com/questions/42911640/rotate-3d-image-batches-to-make-them-2d

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!