packages/pyglGA/scripts/basicCharacterApp.py
def initMeshStatic(filepath):
    """
        initialises the static mesh, calls loadModelAssimp, initialises shaders
    """
    global m_VAO
    global m_Buffers
    global programMesh
    
    global scene
    global pMesh
    
    global light_position
    global ModelViewMesh
    global ProjectionMesh
    global LightPositionMesh
    global textureSampler
    
    global positionS
    global rotationS
    global scaleS

    m_VAO = glGenVertexArrays(1)
    glBindVertexArray(m_VAO)
    
    # static mesh vertex and fragment shaders with Phong shading and lighting    
    meshStaticVert = shaders.compileShader("""
    #version 150 core
    #extension GL_ARB_explicit_attrib_location : enable


    layout (location=0) in vec3    vPosition;
    //in      vec4    vColor;
    layout (location=1) in vec3    vNormal;
    layout (location=2) in vec2    vTexCoord;

    out     vec4    color;
    out     vec2    texCoord;

    uniform mat4    ModelView;
    uniform mat4    Projection;
    uniform vec4    AmbientProduct, DiffuseProduct, SpecularProduct;
    uniform vec4    LightPosition;
    uniform float   Shininess;
    uniform mat4    initialTransform;


    void    main()
    {
    
        // Transform vertex position into eye coordinates
        vec3    pos = (ModelView * vec4(vPosition.x,vPosition.y,vPosition.z,1.0)).xyz;
        // calculate L in light space from Light position - vertex position (eye space)
        vec3    L = normalize(LightPosition.xyz - pos);
        // assume constant viewer at 0,0,0 (in eye space)
        vec3    E = normalize(0-pos);
        // calculate half angle vector
        vec3    H = normalize((L+E)/2);
    
        // for the rest of our Phong calculations we will need the Normal into eye space as well
        // only correct if there is no scale in MV, otherwise we use the InverseTranspose of MV
        vec3    N = normalize( ModelView*vec4(vNormal, 0.0) ).xyz;
    
        // compute terms in the illumination equation
        vec4    ambientTerm = AmbientProduct;
    
        // compute diffuse Phong Term 
        float   diffuseDotProduct = max( dot(L,N), 0.0 ); //calculate >0 only +ve values
        vec4    diffuseTerm = diffuseDotProduct * DiffuseProduct;
    
        // compute specular Phong Term
        float   specularDotProduct = pow( max(dot(N,H), 0.0), Shininess);
        vec4    specularTerm = specularDotProduct * SpecularProduct;
    
        //special provision for dark side highlights
        if (dot(L,N) < 0.0) {
        
           specularTerm = vec4(0.0,0.0,0.0,1.0);
        }
        // outpout per-vertex position in Clip space
        vec4 pos4 = vec4(vPosition.x,vPosition.y,vPosition.z,1.0);
    
        gl_Position = Projection * ModelView * initialTransform * pos4;
    
        // output lighted via the Phong algorithm each vertex color
        //color       = (ambientTerm + diffuseTerm + specularTerm) * vColor;
        color       = (ambientTerm + diffuseTerm + specularTerm);
        // pass to fragment shader per-vertex tex coords
        texCoord    = vTexCoord;
    
        }
                """, GL_VERTEX_SHADER)

    meshStaticFrag = shaders.compileShader("""
       
        #version 150 core

        //varying  vec4  color;
        in      vec4    color;
        in      vec2    texCoord;

        uniform sampler2D   TextureSampler2D;
        uniform float       TexturesPresent;

        out     vec4    colorOUT;

            void main() 
{ 
    //gl_FragColor = color* texture2D(texture, texCoord);
    //colorOUT = color * texture(TextureSampler2D, texCoord);
    //colorOUT = color;
    if (TexturesPresent>0) {
        colorOUT = color * texture(TextureSampler2D, texCoord);
    }
    else
        colorOUT = color;
        //colorOUT = vec4(0.0,0.0,1.0,1.0);
    
    //colorOUT = vec4(0.0,0.0,1.0,1.0);
    //colorOUT = color * texture(TextureSampler2D, texCoord);
} 

                """, GL_FRAGMENT_SHADER)
        
    programMesh = shaders.compileProgram(meshStaticVert, meshStaticFrag)
    glUseProgram(programMesh)
    
    pos, norm, texc = loadModelAssimp(filepath)
    
    # create the VBO
    m_Buffers = glGenBuffers(1)
    glBindBuffer(GL_ARRAY_BUFFER, m_Buffers)
    glBufferData(GL_ARRAY_BUFFER, pos.nbytes + norm.nbytes + texc.nbytes, None, GL_STATIC_DRAW)
    glBufferSubData(GL_ARRAY_BUFFER, 0, pos.nbytes, pos)
    glBufferSubData(GL_ARRAY_BUFFER, pos.nbytes, norm.nbytes, norm)
    glBufferSubData(GL_ARRAY_BUFFER, pos.nbytes + norm.nbytes, texc.nbytes, texc)

    # Position (Vertex VBO)
    glEnableVertexAttribArray(0)
    glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, ctypes.c_void_p(0))

    # print("Normals: ", pos)
    # Normals (Normal VBO)
    glEnableVertexAttribArray(1)
    glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, ctypes.c_void_p(pos.nbytes))

    # Texture (TEXCOORD VBO)
    glEnableVertexAttribArray(2)
    glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, 0, ctypes.c_void_p(pos.nbytes + norm.nbytes))

    glBindBuffer(GL_ARRAY_BUFFER, 0)

    # Index VBO
    EBO = glGenBuffers(1)
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO)
    glBufferData(GL_ELEMENT_ARRAY_BUFFER, pMesh.faces.nbytes, pMesh.faces, GL_STATIC_DRAW)

    light_position = glm.vec4(0., 0., -1., 0.)
    light_ambient = glm.vec4(0.2, 0.2, 0.2, 1.0)
    light_diffuse = glm.vec4(1., 1., 1., 1.)
    light_specular = glm.vec4(1., 1., 1., 1.)

    material_ambient = glm.vec4(0.5, 0.5, 0.5, 1.0)
    material_diffuse = glm.vec4(1., 1., 1., 1.)
    material_specular = glm.vec4(1., 1., 1., 1.)
    material_shininess = 100.

    ambient_product = light_ambient * material_ambient
    diffuse_product = light_diffuse * material_diffuse
    specular_product = light_specular * material_specular

    # print(ambient_product)
    # print(diffuse_product)
    # print(specular_product)

    # Checking if textures are present
    material_texture = 1
    print("Number of textures present: ", len(texc[0]))
    if len(texc[0]) <= 2:
        material_texture = 0
        print("No Textures")

    glUniform4fv(glGetUniformLocation(programMesh, "AmbientProduct"), 1, glm.value_ptr(ambient_product))
    glUniform4fv(glGetUniformLocation(programMesh, "DiffuseProduct"), 1, glm.value_ptr(diffuse_product))
    glUniform4fv(glGetUniformLocation(programMesh, "SpecularProduct"), 1, glm.value_ptr(specular_product))
    glUniform1f(glGetUniformLocation(programMesh, "Shininess"), material_shininess)
    glUniform1f(glGetUniformLocation(programMesh, "TexturesPresent"), material_texture)

     # transformation uniform
    ModelViewMesh = glGetUniformLocation(programMesh, "ModelView")
    ProjectionMesh = glGetUniformLocation(programMesh, "Projection")
    LightPositionMesh = glGetUniformLocation(programMesh, "LightPosition")

    tr = glm.translate(glm.mat4(), positionS)
    rotateX = glm.rotate(tr, rotationS.x, glm.vec3(1., 0., 0.))
    rotateY = glm.rotate(rotateX, rotationS.y, glm.vec3(0., 1., 0.))
    rotateZ = glm.rotate(rotateY, rotationS.z, glm.vec3(0., 0., 1.))
    initialTransformation = glm.scale(rotateZ, glm.vec3(scaleS, scaleS, scaleS))

    glUniformMatrix4fv(glGetUniformLocation(programMesh, "initialTransform"), 1, GL_FALSE,
                           glm.value_ptr(initialTransformation))

    print("initMeshStatic(): \n  ModelViewMesh: ", ModelViewMesh, "\n  ProjectionMesh: ", ProjectionMesh)

    # retrieve texture Sampler2D and init sampler with Texture Unit 0
    textureSampler = glGetUniformLocation(programMesh, "TextureSampler2D")
    glUniform1i(textureSampler, 0)

    glBindBuffer(GL_ARRAY_BUFFER, 0)

        initialises the static mesh, calls loadModelAssimp, initialises shaders
    
initialises the static mesh, calls loadModelAssimp, initialises shaders
initialises the static mesh calls loadModelAssimp initialises shaders
def initMeshStatic(filepath):
    global m_VAO
    global m_Buffers
    global programMesh
    global scene
    global pMesh
    global light_position
    global ModelViewMesh
    global ProjectionMesh
    global LightPositionMesh
    global textureSampler
    global positionS
    global rotationS
    global scaleS
    m_VAO = glGenVertexArrays(1)
    glBindVertexArray(m_VAO)
    meshStaticVert = shaders.compileShader("""
    #version 150 core
    #extension GL_ARB_explicit_attrib_location : enable
    layout (location=0) in vec3    vPosition;
    //in      vec4    vColor;
    layout (location=1) in vec3    vNormal;
    layout (location=2) in vec2    vTexCoord;
    out     vec4    color;
    out     vec2    texCoord;
    uniform mat4    ModelView;
    uniform mat4    Projection;
    uniform vec4    AmbientProduct, DiffuseProduct, SpecularProduct;
    uniform vec4    LightPosition;
    uniform float   Shininess;
    uniform mat4    initialTransform;
    void    main()
    {
        // Transform vertex position into eye coordinates
        vec3    pos = (ModelView * vec4(vPosition.x,vPosition.y,vPosition.z,1.0)).xyz;
        // calculate L in light space from Light position - vertex position (eye space)
        vec3    L = normalize(LightPosition.xyz - pos);
        // assume constant viewer at 0,0,0 (in eye space)
        vec3    E = normalize(0-pos);
        // calculate half angle vector
        vec3    H = normalize((L+E)/2);
        // for the rest of our Phong calculations we will need the Normal into eye space as well
        // only correct if there is no scale in MV, otherwise we use the InverseTranspose of MV
        vec3    N = normalize( ModelView*vec4(vNormal, 0.0) ).xyz;
        // compute terms in the illumination equation
        vec4    ambientTerm = AmbientProduct;
        // compute diffuse Phong Term 
        float   diffuseDotProduct = max( dot(L,N), 0.0 ); //calculate >0 only +ve values
        vec4    diffuseTerm = diffuseDotProduct * DiffuseProduct;
        // compute specular Phong Term
        float   specularDotProduct = pow( max(dot(N,H), 0.0), Shininess);
        vec4    specularTerm = specularDotProduct * SpecularProduct;
        //special provision for dark side highlights
        if (dot(L,N) < 0.0) {
           specularTerm = vec4(0.0,0.0,0.0,1.0);
        }
        // outpout per-vertex position in Clip space
        vec4 pos4 = vec4(vPosition.x,vPosition.y,vPosition.z,1.0);
        gl_Position = Projection * ModelView * initialTransform * pos4;
        // output lighted via the Phong algorithm each vertex color
        //color       = (ambientTerm + diffuseTerm + specularTerm) * vColor;
        color       = (ambientTerm + diffuseTerm + specularTerm);
        // pass to fragment shader per-vertex tex coords
        texCoord    = vTexCoord;
        }
                """, GL_VERTEX_SHADER)
    meshStaticFrag = shaders.compileShader("""
        #version 150 core
        //varying  vec4  color;
        in      vec4    color;
        in      vec2    texCoord;
        uniform sampler2D   TextureSampler2D;
        uniform float       TexturesPresent;
        out     vec4    colorOUT;
            void main() 
{ 
    //gl_FragColor = color* texture2D(texture, texCoord);
    //colorOUT = color * texture(TextureSampler2D, texCoord);
    //colorOUT = color;
    if (TexturesPresent>0) {
        colorOUT = color * texture(TextureSampler2D, texCoord);
    }
    else
        colorOUT = color;
        //colorOUT = vec4(0.0,0.0,1.0,1.0);
    //colorOUT = vec4(0.0,0.0,1.0,1.0);
    //colorOUT = color * texture(TextureSampler2D, texCoord);
} 
                """, GL_FRAGMENT_SHADER)
    programMesh = shaders.compileProgram(meshStaticVert, meshStaticFrag)
    glUseProgram(programMesh)
    pos, norm, texc = loadModelAssimp(filepath)
    m_Buffers = glGenBuffers(1)
    glBindBuffer(GL_ARRAY_BUFFER, m_Buffers)
    glBufferData(GL_ARRAY_BUFFER, pos.nbytes + norm.nbytes + texc.nbytes, None, GL_STATIC_DRAW)
    glBufferSubData(GL_ARRAY_BUFFER, 0, pos.nbytes, pos)
    glBufferSubData(GL_ARRAY_BUFFER, pos.nbytes, norm.nbytes, norm)
    glBufferSubData(GL_ARRAY_BUFFER, pos.nbytes + norm.nbytes, texc.nbytes, texc)
    glEnableVertexAttribArray(0)
    glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, ctypes.c_void_p(0))
    glEnableVertexAttribArray(1)
    glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, ctypes.c_void_p(pos.nbytes))
    glEnableVertexAttribArray(2)
    glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, 0, ctypes.c_void_p(pos.nbytes + norm.nbytes))
    glBindBuffer(GL_ARRAY_BUFFER, 0)
    EBO = glGenBuffers(1)
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO)
    glBufferData(GL_ELEMENT_ARRAY_BUFFER, pMesh.faces.nbytes, pMesh.faces, GL_STATIC_DRAW)
    light_position = glm.vec4(0., 0., -1., 0.)
    light_ambient = glm.vec4(0.2, 0.2, 0.2, 1.0)
    light_diffuse = glm.vec4(1., 1., 1., 1.)
    light_specular = glm.vec4(1., 1., 1., 1.)
    material_ambient = glm.vec4(0.5, 0.5, 0.5, 1.0)
    material_diffuse = glm.vec4(1., 1., 1., 1.)
    material_specular = glm.vec4(1., 1., 1., 1.)
    material_shininess = 100.
    ambient_product = light_ambient * material_ambient
    diffuse_product = light_diffuse * material_diffuse
    specular_product = light_specular * material_specular
    material_texture = 1
    print("Number of textures present: ", len(texc[0]))
    if len(texc[0]) <= 2:
        material_texture = 0
        print("No Textures")
    glUniform4fv(glGetUniformLocation(programMesh, "AmbientProduct"), 1, glm.value_ptr(ambient_product))
    glUniform4fv(glGetUniformLocation(programMesh, "DiffuseProduct"), 1, glm.value_ptr(diffuse_product))
    glUniform4fv(glGetUniformLocation(programMesh, "SpecularProduct"), 1, glm.value_ptr(specular_product))
    glUniform1f(glGetUniformLocation(programMesh, "Shininess"), material_shininess)
    glUniform1f(glGetUniformLocation(programMesh, "TexturesPresent"), material_texture)
    ModelViewMesh = glGetUniformLocation(programMesh, "ModelView")
    ProjectionMesh = glGetUniformLocation(programMesh, "Projection")
    LightPositionMesh = glGetUniformLocation(programMesh, "LightPosition")
    tr = glm.translate(glm.mat4(), positionS)
    rotateX = glm.rotate(tr, rotationS.x, glm.vec3(1., 0., 0.))
    rotateY = glm.rotate(rotateX, rotationS.y, glm.vec3(0., 1., 0.))
    rotateZ = glm.rotate(rotateY, rotationS.z, glm.vec3(0., 0., 1.))
    initialTransformation = glm.scale(rotateZ, glm.vec3(scaleS, scaleS, scaleS))
    glUniformMatrix4fv(glGetUniformLocation(programMesh, "initialTransform"), 1, GL_FALSE,
                           glm.value_ptr(initialTransformation))
    print("initMeshStatic(): \n  ModelViewMesh: ", ModelViewMesh, "\n  ProjectionMesh: ", ProjectionMesh)
    textureSampler = glGetUniformLocation(programMesh, "TextureSampler2D")
    glUniform1i(textureSampler, 0)
    glBindBuffer(GL_ARRAY_BUFFER, 0)
def initMeshStatic ( filepath ) : global m_VAO global m_Buffers global programMesh global scene global pMesh global light_position global ModelViewMesh global ProjectionMesh global LightPositionMesh global textureSampler global positionS global rotationS global scaleS m_VAO = glGenVertexArrays ( 1 ) glBindVertexArray ( m_VAO ) meshStaticVert = shaders . compileShader ( """
    #version 150 core
    #extension GL_ARB_explicit_attrib_location : enable


    layout (location=0) in vec3    vPosition;
    //in      vec4    vColor;
    layout (location=1) in vec3    vNormal;
    layout (location=2) in vec2    vTexCoord;

    out     vec4    color;
    out     vec2    texCoord;

    uniform mat4    ModelView;
    uniform mat4    Projection;
    uniform vec4    AmbientProduct, DiffuseProduct, SpecularProduct;
    uniform vec4    LightPosition;
    uniform float   Shininess;
    uniform mat4    initialTransform;


    void    main()
    {
    
        // Transform vertex position into eye coordinates
        vec3    pos = (ModelView * vec4(vPosition.x,vPosition.y,vPosition.z,1.0)).xyz;
        // calculate L in light space from Light position - vertex position (eye space)
        vec3    L = normalize(LightPosition.xyz - pos);
        // assume constant viewer at 0,0,0 (in eye space)
        vec3    E = normalize(0-pos);
        // calculate half angle vector
        vec3    H = normalize((L+E)/2);
    
        // for the rest of our Phong calculations we will need the Normal into eye space as well
        // only correct if there is no scale in MV, otherwise we use the InverseTranspose of MV
        vec3    N = normalize( ModelView*vec4(vNormal, 0.0) ).xyz;
    
        // compute terms in the illumination equation
        vec4    ambientTerm = AmbientProduct;
    
        // compute diffuse Phong Term 
        float   diffuseDotProduct = max( dot(L,N), 0.0 ); //calculate >0 only +ve values
        vec4    diffuseTerm = diffuseDotProduct * DiffuseProduct;
    
        // compute specular Phong Term
        float   specularDotProduct = pow( max(dot(N,H), 0.0), Shininess);
        vec4    specularTerm = specularDotProduct * SpecularProduct;
    
        //special provision for dark side highlights
        if (dot(L,N) < 0.0) {
        
           specularTerm = vec4(0.0,0.0,0.0,1.0);
        }
        // outpout per-vertex position in Clip space
        vec4 pos4 = vec4(vPosition.x,vPosition.y,vPosition.z,1.0);
    
        gl_Position = Projection * ModelView * initialTransform * pos4;
    
        // output lighted via the Phong algorithm each vertex color
        //color       = (ambientTerm + diffuseTerm + specularTerm) * vColor;
        color       = (ambientTerm + diffuseTerm + specularTerm);
        // pass to fragment shader per-vertex tex coords
        texCoord    = vTexCoord;
    
        }
                """ , GL_VERTEX_SHADER ) meshStaticFrag = shaders . compileShader ( """
       
        #version 150 core

        //varying  vec4  color;
        in      vec4    color;
        in      vec2    texCoord;

        uniform sampler2D   TextureSampler2D;
        uniform float       TexturesPresent;

        out     vec4    colorOUT;

            void main() 
{ 
    //gl_FragColor = color* texture2D(texture, texCoord);
    //colorOUT = color * texture(TextureSampler2D, texCoord);
    //colorOUT = color;
    if (TexturesPresent>0) {
        colorOUT = color * texture(TextureSampler2D, texCoord);
    }
    else
        colorOUT = color;
        //colorOUT = vec4(0.0,0.0,1.0,1.0);
    
    //colorOUT = vec4(0.0,0.0,1.0,1.0);
    //colorOUT = color * texture(TextureSampler2D, texCoord);
} 

                """ , GL_FRAGMENT_SHADER ) programMesh = shaders . compileProgram ( meshStaticVert , meshStaticFrag ) glUseProgram ( programMesh ) pos , norm , texc = loadModelAssimp ( filepath ) m_Buffers = glGenBuffers ( 1 ) glBindBuffer ( GL_ARRAY_BUFFER , m_Buffers ) glBufferData ( GL_ARRAY_BUFFER , pos . nbytes + norm . nbytes + texc . nbytes , None , GL_STATIC_DRAW ) glBufferSubData ( GL_ARRAY_BUFFER , 0 , pos . nbytes , pos ) glBufferSubData ( GL_ARRAY_BUFFER , pos . nbytes , norm . nbytes , norm ) glBufferSubData ( GL_ARRAY_BUFFER , pos . nbytes + norm . nbytes , texc . nbytes , texc ) glEnableVertexAttribArray ( 0 ) glVertexAttribPointer ( 0 , 3 , GL_FLOAT , GL_FALSE , 0 , ctypes . c_void_p ( 0 ) ) glEnableVertexAttribArray ( 1 ) glVertexAttribPointer ( 1 , 3 , GL_FLOAT , GL_FALSE , 0 , ctypes . c_void_p ( pos . nbytes ) ) glEnableVertexAttribArray ( 2 ) glVertexAttribPointer ( 2 , 2 , GL_FLOAT , GL_FALSE , 0 , ctypes . c_void_p ( pos . nbytes + norm . nbytes ) ) glBindBuffer ( GL_ARRAY_BUFFER , 0 ) EBO = glGenBuffers ( 1 ) glBindBuffer ( GL_ELEMENT_ARRAY_BUFFER , EBO ) glBufferData ( GL_ELEMENT_ARRAY_BUFFER , pMesh . faces . nbytes , pMesh . faces , GL_STATIC_DRAW ) light_position = glm . vec4 ( 0. , 0. , - 1. , 0. ) light_ambient = glm . vec4 ( 0.2 , 0.2 , 0.2 , 1.0 ) light_diffuse = glm . vec4 ( 1. , 1. , 1. , 1. ) light_specular = glm . vec4 ( 1. , 1. , 1. , 1. ) material_ambient = glm . vec4 ( 0.5 , 0.5 , 0.5 , 1.0 ) material_diffuse = glm . vec4 ( 1. , 1. , 1. , 1. ) material_specular = glm . vec4 ( 1. , 1. , 1. , 1. ) material_shininess = 100. ambient_product = light_ambient * material_ambient diffuse_product = light_diffuse * material_diffuse specular_product = light_specular * material_specular material_texture = 1 print ( "Number of textures present: " , len ( texc [ 0 ] ) ) if len ( texc [ 0 ] ) <= 2 : material_texture = 0 print ( "No Textures" ) glUniform4fv ( glGetUniformLocation ( programMesh , "AmbientProduct" ) , 1 , glm . value_ptr ( ambient_product ) ) glUniform4fv ( glGetUniformLocation ( programMesh , "DiffuseProduct" ) , 1 , glm . value_ptr ( diffuse_product ) ) glUniform4fv ( glGetUniformLocation ( programMesh , "SpecularProduct" ) , 1 , glm . value_ptr ( specular_product ) ) glUniform1f ( glGetUniformLocation ( programMesh , "Shininess" ) , material_shininess ) glUniform1f ( glGetUniformLocation ( programMesh , "TexturesPresent" ) , material_texture ) ModelViewMesh = glGetUniformLocation ( programMesh , "ModelView" ) ProjectionMesh = glGetUniformLocation ( programMesh , "Projection" ) LightPositionMesh = glGetUniformLocation ( programMesh , "LightPosition" ) tr = glm . translate ( glm . mat4 ( ) , positionS ) rotateX = glm . rotate ( tr , rotationS . x , glm . vec3 ( 1. , 0. , 0. ) ) rotateY = glm . rotate ( rotateX , rotationS . y , glm . vec3 ( 0. , 1. , 0. ) ) rotateZ = glm . rotate ( rotateY , rotationS . z , glm . vec3 ( 0. , 0. , 1. ) ) initialTransformation = glm . scale ( rotateZ , glm . vec3 ( scaleS , scaleS , scaleS ) ) glUniformMatrix4fv ( glGetUniformLocation ( programMesh , "initialTransform" ) , 1 , GL_FALSE , glm . value_ptr ( initialTransformation ) ) print ( "initMeshStatic(): \n  ModelViewMesh: " , ModelViewMesh , "\n  ProjectionMesh: " , ProjectionMesh ) textureSampler = glGetUniformLocation ( programMesh , "TextureSampler2D" ) glUniform1i ( textureSampler , 0 ) glBindBuffer ( GL_ARRAY_BUFFER , 0 )
initialises the static mesh, calls loadModelAssimp, initialises shaders
initialises the static mesh calls loadModelAssimp initialises shaders
"""
        initialises the static mesh, calls loadModelAssimp, initialises shaders
    """ # static mesh vertex and fragment shaders with Phong shading and lighting     # create the VBO # Position (Vertex VBO) # print("Normals: ", pos) # Normals (Normal VBO) # Texture (TEXCOORD VBO) # Index VBO # print(ambient_product) # print(diffuse_product) # print(specular_product) # Checking if textures are present # transformation uniform # retrieve texture Sampler2D and init sampler with Texture Unit 0
filepath