Last bit of tape before turning assignment 1

This commit is contained in:
2020-02-26 19:00:45 -05:00
parent a12a99404e
commit 7dfb188fd2
20 changed files with 71 additions and 100 deletions

View File

@ -91,7 +91,7 @@ namespace DGL
transform = Translate(transform, position);
transform = Scale (transform, scale );
valueLoop += 0.31879f * _delta;
valueLoop += 0.31879f * gFloat(_delta);
return;
}
@ -232,9 +232,9 @@ namespace DGL
transform = CoordSpace(1.0f);
transform = DGL::Translate(transform, position);
transform = Translate(transform, position);
transform = DGL::Scale(transform, scale);
transform = Scale(transform, scale);
return;
}
@ -245,9 +245,9 @@ namespace DGL
transform = CoordSpace(1.0f);
transform = DGL::Translate(transform, position);
transform = Translate(transform, position);
transform = DGL::Scale(transform, scale);
transform = Scale(transform, scale);
return;
}
@ -281,7 +281,7 @@ namespace DGL
private:
//EEntityType type;
// EEntityType type;
Vector3 position ;
Vector3 scale ;

View File

@ -3,7 +3,7 @@ Title : Ducktaped GL: Model
Author: Edward R. Gonzalez
Description:
Allows the management of loading and buffer/rendering models from wavefront obj file sources.
*/
#pragma once
@ -120,6 +120,8 @@ namespace DGL
if (normals.size() > 0)
{
//generated.Normals.vec[index] = normals[index];
// Not using built in normals for now...
}
}
@ -157,11 +159,6 @@ namespace DGL
normal = GetCrossNormal(edge1, edge2);
//faces[faceIndex].Normals.vec[0] = vertexIndex1;
//faces[faceIndex].Normals.vec[1] = vertexIndex2;
//faces[faceIndex].Normals.vec[2] = vertexIndex3;
normals[vertexIndex1] += normal;
normals[vertexIndex2] += normal;
normals[vertexIndex3] += normal;
@ -169,14 +166,6 @@ namespace DGL
for (int index = 0; index < normals.size(); index++)
{
/*gFloat magnitude = 0.0f;
magnitude = normals[index].x + normals[index].y + normals[index].z;
normals[index].x /= magnitude;
normals[index].y /= magnitude;
normals[index].z /= magnitude;*/
normals[index] = GetDirection(normals[index]);
}
}
@ -201,6 +190,8 @@ namespace DGL
// Hardcoded to only do the verticies and normals for now...
void Buffer()
{
// Generate buffers
GenerateVertexBuffers(vertexArrayID , 1);
GenerateBuffers (vertexBufferID , 1);
GenerateBuffers (normalBuffferID, 1);
@ -256,24 +247,11 @@ namespace DGL
}
BindBuffer(EBufferTarget::VertexIndices, elementBufferID);
BufferData(faces[0], gSize(faces.size() * sizeof(Face)), EBufferTarget::VertexIndices, EBufferUsage::StaticDraw);
UnbindVertexArray(); // Unbind vertex array.
/*for (int index = 0; index < verticies.size(); index++)
{
cout << "Vertex: " << verticies[index].x << ", " << verticies[index].y << ", " << ", " << verticies[index].z << endl;
}
for (int index = 0; index < verticies.size(); index++)
{
cout << "Normal: " << normals[index].x << ", " << normals[index].y << ", " << ", " << normals[index].z << endl;
}*/
}
void Load()

View File

@ -1,3 +1,12 @@
/*
Title : Ducktaped GL: Shader
Author: Edward R. Gonzalez
Description:
All the wrappers for the openGL shader related and and implementation of a basic light and phong shader.
*/
#pragma once
//DGL

View File

@ -1,3 +1,11 @@
/*
Title : Ducktaped GL: Space
Author: Edward R. Gonzalez
Description:
Contains related functionality for dealing with 3D-Space, and viewing.
*/
#pragma once
// GLM

View File

@ -1,3 +1,12 @@
/*
Title : Ducktaped GL: Utilities
Author: Edward R. Gonzalez
Description:
The header with the general functionality for using glm/glfw/glew.
*/
#pragma once
// GLFW, GLEW, GLM
@ -18,6 +27,7 @@
#include "Cpp_Alias.hpp"
namespace DGL
{
// Object Instances
@ -232,6 +242,11 @@ namespace DGL
return;
}
void SetWindowHeader(Window* const _window, string _title)
{
glfwSetWindowTitle(_window, _title.c_str());
}
void SwapBuffers(Window* const _window)
{
glfwSwapBuffers(_window);