summaryrefslogtreecommitdiff
path: root/glgfx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'glgfx.cpp')
-rw-r--r--glgfx.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/glgfx.cpp b/glgfx.cpp
index bed50d4..7b54254 100644
--- a/glgfx.cpp
+++ b/glgfx.cpp
@@ -243,7 +243,7 @@ int setlight (float x, float y, float z) {
}
//draws the model, setting perspective transform and position transform
//done with magic numbers for now for testing purposes
-int drawmodel(float x, float y, float z, float xr, float yr, float zr) {
+int drawmodel(float x, float y, float z, float xr, float yr, float zr, float s) {
// the transformation matrix = rotation matrix of object * scaling matrix * translaton matrix representing difference in camera and object location * -rotation matrix of the camera * perspective transform
//order of application ir right to left
//fov, aspect ratio, size of near and far planes distance
@@ -259,12 +259,12 @@ int drawmodel(float x, float y, float z, float xr, float yr, float zr) {
//);
//the translation matrix, matrixes added last are applied first
glm::mat4 tran;
+ tran = glm::scale(tran, glm::vec3(s,s,s));
tran = glm::translate(tran, glm::vec3(x,y,z));
tran = glm::rotate(tran,glm::radians(xr),glm::vec3(1,0,0)); // axis of rotation x y z
tran = glm::rotate(tran,glm::radians(yr),glm::vec3(0,1,0));
tran = glm::rotate(tran,glm::radians(zr),glm::vec3(0,0,1));
glm::mat4 rot;
- tran = glm::translate(tran, glm::vec3(0,0,0));
rot = glm::rotate(rot,glm::radians(xr),glm::vec3(1,0,0)); // axis of rotation x y z
rot = glm::rotate(rot,glm::radians(yr),glm::vec3(0,1,0));
rot = glm::rotate(rot,glm::radians(zr),glm::vec3(0,0,1));