void BMD::RenderVertexBuffer(int i, Mesh_t* m, int vertex_index, vec3_t* vertices, vec2_t* textCoords)
{
GLuint shader_id = gShaderGL->GetShaderId();
glUseProgram(shader_id);
glm::mat4 model;
for (int j = 0; j < m->NumVertices; j++)
{
Vertex_t* v = &m->Vertices[j];
float* vp = VertexTransform[j];
VectorTransform(v->Position, BoneMatrix[v->Node], vp);
VectorRotate(v->Position, BoneMatrix[v->Node], vp);
vp[0] = vp[0] * BoneScale + BoneMatrix[v->Node][0][3];
vp[1] = vp[1] * BoneScale + BoneMatrix[v->Node][1][3];
vp[2] = vp[2] * BoneScale + BoneMatrix[v->Node][2][3];
model = glm::translate(glm::mat4(1.0f), vp);
}
glm::mat4 view = glm::lookAt(glm::vec3(-CameraPosition[0], -CameraPosition[1], -CameraPosition[2]), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 1.0f, 0.0f));
glm::mat4 projection = glm::perspective(glm::radians(CameraFOV), (float)WindowWidth / (float)WindowHeight, CameraViewNear, CameraViewFar * 1.4f);
glUniformMatrix4fv(glGetUniformLocation(shader_id, "projection"), 1, GL_FALSE, glm::value_ptr(projection));
// Enviar la matriz de vista
glUniformMatrix4fv(glGetUniformLocation(shader_id, "view"), 1, GL_FALSE, glm::value_ptr(view));
// Enviar la matriz de modelo
glUniformMatrix4fv(glGetUniformLocation(shader_id, "model"), 1, GL_FALSE, glm::value_ptr(model));
glBindVertexArray(m->VAO);
glDrawElements(GL_TRIANGLES, vertex_index, GL_UNSIGNED_SHORT, 0);
glBindVertexArray(0);
glUseProgram(0);
}
it will look like this
How to implement in the renderMesh and other renders?
Eu hein ? O_O Rafael Dias pedindo ajuda na TuServerMU ? Eu estou vendo isso mesmo ? Aqui não era a Cracolandia do MU e você não precisava de nada de forum ?
Mundo gira hem..., porque não usa seu nome verdadeiro.... vergonha... retaliação ...
Falta humildade..... EU HEINNNN !
What the hell? O_O Rafael Dias asking for help on TuServerMU? Am I really seeing this? Wasn't this the MU's Crackland and you didn't need any forums?
Fra mundo huh..., why don't you use your real name.... shame... retaliation...
Lack of humility..... WHAT THE HELL!!
Assim são os amigos falsos e covardes, eles se escondem