Пример #1
0
glfw.set_input_mode(window, glfw.CURSOR, glfw.CURSOR_DISABLED)
glfw.set_cursor_pos_callback(window, mouse_callback)
glfw.set_scroll_callback(window, scroll_callback)
glfw.set_mouse_button_callback(window, mousebutton_callback)

glfw.set_error_callback(error_callback)

## Load, compile, link shaders
import myshader
shaders = myshader.shader("shaders/hellocoord.vert", "shaders/hellocoord.frag")
shaders.linkShaders()

# ## Textures
import mytexture
t1 = mytexture.texture('resources/wall.jpg', GL_TEXTURE0)
# t2 = mytexture.texture('awesomeface.png', GL_TEXTURE1)

## Scene
import mycube

import numpy as np
vertices = mycube.vertices

cubePositions = [
    glm.vec3(0.0, 0.0, 0.0),
    glm.vec3(2.0, 5.0, -15.0),
    glm.vec3(-1.5, -2.2, -2.5),
    glm.vec3(-3.8, -2.0, -12.3),
    glm.vec3(2.4, -0.4, -3.5),
    glm.vec3(-1.7, 3.0, -7.5),
Пример #2
0
glfw.set_scroll_callback(window, inputMgr.get_scroll_callback())
glfw.set_mouse_button_callback(window, inputMgr.get_mousebutton_callback())

glfw.set_error_callback(inputMgr.get_error_callback())

## Load, compile, link shaders
shaders = myshader.shader("shaders/basiclight-texture.vert",
                          "shaders/texturedobj.frag")
shaders.linkShaders()

lightshader = myshader.shader("shaders/hellolightingcol.vert",
                              "shaders/hellolight.frag")
lightshader.linkShaders()

# ## Textures
t1 = mytexture.texture('resources/equirectangular.jpg', GL_TEXTURE0)
t2 = mytexture.texture('resources/container2.png', GL_TEXTURE1)
t3 = mytexture.texture('resources/container2_specular.png', GL_TEXTURE2)

## Scene
import mycube
import mysphere

mycubevertices = mycube.verticeswithnormals
myspherevertices = mysphere.sphere_vertices(30)
nbspheretriangles = int(len(myspherevertices) / 5 * 3)

cubePositions = [
    # glm.vec3( 0.0,  0.0,  0.0),
    glm.vec3(2.0, 5.0, -15.0),
    glm.vec3(-1.5, -2.2, -2.5),
Пример #3
0
glfw.set_scroll_callback(window, inputMgr.get_scroll_callback())
glfw.set_mouse_button_callback(window, inputMgr.get_mousebutton_callback())

glfw.set_error_callback(inputMgr.get_error_callback())

## Load, compile, link shaders
shaders = myshader.shader("shaders/basiclight-texture.vert",
                          "shaders/basiclight-onoff.frag")
shaders.linkShaders()

lightshader = myshader.shader("shaders/hellolightingcol.vert",
                              "shaders/hellolight.frag")
lightshader.linkShaders()

# ## Textures
t1 = mytexture.texture('resources/equirectangular.jpg', GL_TEXTURE0)
# t2 = mytexture.texture('awesomeface.png', GL_TEXTURE1)

## Scene
import mycube
import mysphere

mycubevertices = mycube.verticeswithnormals
myspherevertices = mysphere.sphere_vertices(30)
nbspheretriangles = int(len(myspherevertices) / 5 * 3)

cubePositions = [
    glm.vec3(0.0, 0.0, 0.0),
    glm.vec3(2.0, 5.0, -15.0),
    glm.vec3(-1.5, -2.2, -2.5),
    glm.vec3(-3.8, -2.0, -12.3),