diff options
author | knolax <1339802534.kk@gmail.com> | 2017-03-01 10:51:50 -0500 |
---|---|---|
committer | knolax <1339802534.kk@gmail.com> | 2017-03-01 10:51:50 -0500 |
commit | 50462167289384ba8c546331a71d8d8558f06c80 (patch) | |
tree | 655c34c43889c47e86a8d9f5159af8850158c08c /glgfx.cpp | |
parent | cf3f284a5f24bd02006e9ff929cc29d10c428a3e (diff) |
changed the elevation texture and switched the diffuse/reflect value positions
Diffstat (limited to 'glgfx.cpp')
-rw-r--r-- | glgfx.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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)); |