def high_shot(): # first obj obj = 'deer/deer_normals.obj' translate = (-0.5, 0, 0) scale = (0.1, 0.15, 0.1) rotate = (0, 0, 0) intensity = 1 # texture = texture_loader('deer/deer.bmp') print('Rendering: ' + obj + '\ntranslate: ' + str(translate) + '\nscale: ' + str(scale)) print('Please wait...') init_renderer() GL.glLookAt(VERTEX_3(10, 25, 28), VERTEX_3(0, -0.2, 0), VERTEX_3(0, 1, 0)) GL.glLoadObj(obj, translate, scale, rotate, intensity) # second obj obj = 'deer/deer_normals.obj' translate = (0.5, 0, 0) scale = (0.1, 0.17, 0.1) rotate = (0, 0, 0) intensity = 1 texture = texture_loader('deer/deer.bmp') print('Rendering: ' + obj + '\ntranslate: ' + str(translate) + '\nscale: ' + str(scale)) print('Please wait...') GL.glLoadObj(obj, translate, scale, rotate, intensity, texture) GL.glFinish() print('Output rendered to: \'render.bmp\'')
def render(): # mars obj = 'planet/planet.obj' translate = (0, 0, 0) scale = (0.1, 0.15, 0.1) rotate = (0, 0, 0) intensity = 1 print('Rendering: ' + obj + '\ntranslate: ' + str(translate) + '\nscale: ' + str(scale)) print('Please wait...') init_renderer() GL.glLookAt(VERTEX_3(20, 1, 20), VERTEX_3(0, 0, 0), VERTEX_3(0, 1, 0)) GL.glDrawStars() GL.renderIs = 'planet' GL.glLoadObj(obj, translate, scale, rotate, intensity) # phobos obj = 'planet/moon.obj' translate = (0.8, 0.3, 0) scale = (0.02, 0.03, 0.02) rotate = (0, 0, 0) intensity = 1 print('Rendering: ' + obj + '\ntranslate: ' + str(translate) + '\nscale: ' + str(scale)) print('Please wait...') GL.renderIs = 'moon' GL.glLoadObj(obj, translate, scale, rotate, intensity) # deimos obj = 'planet/moon.obj' translate = (0.7, -0.3, 0) scale = (0.015, 0.008, 0.01) rotate = (0, 0, 5) intensity = 1 print('Rendering: ' + obj + '\ntranslate: ' + str(translate) + '\nscale: ' + str(scale)) print('Please wait...') GL.renderIs = 'moon' GL.glLoadObj(obj, translate, scale, rotate, intensity) GL.glFinish() print('Output rendered to: \'render.bmp\'')
def draw_deer_centered(): obj = 'deer/deer.obj' translate = (0, 0, 0) scale = (0.1, 0.1, 0.1) rotate = (0, 25, 0) intensity = 1 texture = texture_loader('deer/deer.bmp') print('Rendering: ' + obj + '\ntranslate: ' + str(translate) + '\nscale: ' + str(scale)) init_renderer() GL.glLookAt(VERTEX_3(12, 1, 0), VERTEX_3(0, 0, 0), VERTEX_3(1, 1, 0)) GL.glLoadObj(obj, translate, scale, rotate, intensity, texture) GL.glFinish() print('Output rendered to: \'render.bmp\'')
def low_shot(): obj = 'deer/deer.obj' translate = (0, 0, 0) scale = (0.1, 0.15, 0.1) rotate = (0, 0, 0) intensity = 1 texture = texture_loader('deer/deer.bmp') print('Rendering: ' + obj + '\ntranslate: ' + str(translate) + '\nscale: ' + str(scale)) print('Please wait...') init_renderer() GL.glLookAt(VERTEX_3(10, -6.5, 5), VERTEX_3(0, -0.2, 0), VERTEX_3(0, 1, 0)) GL.glLoadObj(obj, translate, scale, rotate, intensity, texture) GL.glFinish() print('Output rendered to: \'render.bmp\'')
def forest(): # first obj obj = 'forest/base.obj' translate = (0, -0.8, -0.8) scale = (0.1, 0.15, 0.1) rotate = (0, 0, 0) intensity = 1 texture = texture_loader('forest/base.bmp') print('Rendering: ' + obj + '\ntranslate: ' + str(translate) + '\nscale: ' + str(scale)) print('Please wait...') init_renderer() GL.glLookAt( VERTEX_3(10, 25, 30), VERTEX_3(0, -0.2, 0), VERTEX_3(0, 1, 0) ) GL.glLoadObj(obj, translate, scale, rotate, intensity, texture) # second obj obj = 'deer/deer_normals.obj' translate = (-0.2, 0, 0) scale = (0.08, 0.15, 0.08) rotate = (0, 0, 0) intensity = 1 texture = texture_loader('deer/deer.bmp') print('Rendering: ' + obj + '\ntranslate: ' + str(translate) + '\nscale: ' + str(scale)) print('Please wait...') GL.glLoadObj(obj, translate, scale, rotate, intensity, texture) # third obj obj = 'forest/bhudist_stone.obj' translate = (0.75, 0, 0) scale = (0.1, 0.15, 0.1) rotate = (0, 0, 0) intensity = 1 texture = texture_loader('forest/bhudist_stone.bmp') print('Rendering: ' + obj + '\ntranslate: ' + str(translate) + '\nscale: ' + str(scale)) print('Please wait...') GL.glLoadObj(obj, translate, scale, rotate, intensity, texture) # fourth obj obj = 'forest/rock.obj' translate = (-0.3, -0.3, 1) scale = (0.1, 0.15, 0.1) rotate = (0, 0, 0) intensity = 1 texture = texture_loader('forest/rock.bmp') print('Rendering: ' + obj + '\ntranslate: ' + str(translate) + '\nscale: ' + str(scale)) print('Please wait...') GL.glLoadObj(obj, translate, scale, rotate, intensity, texture) # fifth obj obj = 'forest/log_normals.obj' translate = (0.75, -0.08, 1) scale = (0.1, 0.15, 0.1) rotate = (0, 0.1, 0) intensity = 1 texture = texture_loader('forest/log.bmp') print('Rendering: ' + obj + '\ntranslate: ' + str(translate) + '\nscale: ' + str(scale)) print('Please wait...') GL.glLoadObj(obj, translate, scale, rotate, intensity, texture) # sixth obj obj = 'forest/wall.obj' translate = (1.35, 3.6, 3.2) scale = (0.1, 0.15, 0.1) rotate = (0, 0.1, 0) intensity = 1 texture = texture_loader('forest/wall.bmp') print('Rendering: ' + obj + '\ntranslate: ' + str(translate) + '\nscale: ' + str(scale)) print('Please wait...') GL.glLoadObj(obj, translate, scale, rotate, intensity, texture) # seventh obj obj = 'forest/fern.obj' translate = (-0.50, -0.35, 1) scale = (0.1, 0.15, 0.1) rotate = (0, 0, 0) intensity = 1 texture = texture_loader('forest/fern.bmp') print('Rendering: ' + obj + '\ntranslate: ' + str(translate) + '\nscale: ' + str(scale)) print('Please wait...') GL.glLoadObj(obj, translate, scale, rotate, intensity, texture) # eight obj obj = 'forest/cobblestone.obj' translate = (-0.1, -0.60, 1) scale = (0.1, 0.15, 0.1) rotate = (0, 0, 0) intensity = 1 texture = texture_loader('forest/cobblestone.bmp') print('Rendering: ' + obj + '\ntranslate: ' + str(translate) + '\nscale: ' + str(scale)) print('Please wait...') GL.glLoadObj(obj, translate, scale, rotate, intensity, texture) # eight obj obj = 'forest/cobblestone.obj' translate = (0.8, -0.60, 1) scale = (0.1, 0.15, 0.1) rotate = (0, 0, 0) intensity = 1 texture = texture_loader('forest/cobblestone.bmp') print('Rendering: ' + obj + '\ntranslate: ' + str(translate) + '\nscale: ' + str(scale)) print('Please wait...') GL.glLoadObj(obj, translate, scale, rotate, intensity, texture) GL.glFinish() print('Output rendered to: \'render.bmp\'')