diff --git a/src/ModelManager/ModelManager.cpp b/src/ModelManager/ModelManager.cpp index fa91202..1e85f68 100644 --- a/src/ModelManager/ModelManager.cpp +++ b/src/ModelManager/ModelManager.cpp @@ -256,6 +256,7 @@ void TLiteModel::MoveModel(const vec3& v) { for (cardinal i = 0; i < TriangleCount * 3; i++) { + vertexDataStruct.PositionData[i] += v; //TriangleList.Data.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB][i] += v; } } @@ -265,6 +266,7 @@ void TLiteModel::RotateModel(const mat3& r) for (cardinal i = 0; i < TriangleCount * 3; i++) { + vertexDataStruct.PositionData[i] = r * vertexDataStruct.PositionData[i]; //TriangleList.Data.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB][i] = r * TriangleList.Data.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB][i]; //TriangleList.Data.Vec3CoordArr[CONST_STRING_NORMAL_ATTRIB][i] = r * TriangleList.Data.Vec3CoordArr[CONST_STRING_NORMAL_ATTRIB][i]; //TriangleList.Data.Vec3CoordArr[CONST_STRING_TANGENT_ATTRIB][i] = r * TriangleList.Data.Vec3CoordArr[CONST_STRING_TANGENT_ATTRIB][i]; @@ -277,6 +279,7 @@ void TLiteModel::ScaleModel(float s) for (cardinal i = 0; i < TriangleCount * 3; i++) { + vertexDataStruct.PositionData[i] *= s; //TriangleList.Data.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB][i] *= s; } @@ -288,6 +291,9 @@ void TLiteModel::ScaleModel(const vec3& s) for (cardinal i = 0; i < TriangleCount * 3; i++) { + vertexDataStruct.PositionData[i].v[0] *= s.v[0]; + vertexDataStruct.PositionData[i].v[1] *= s.v[1]; + vertexDataStruct.PositionData[i].v[2] *= s.v[2]; //TriangleList.Data.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB][i].v[0] *= s.v[0]; //TriangleList.Data.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB][i].v[1] *= s.v[1]; //TriangleList.Data.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB][i].v[2] *= s.v[2]; diff --git a/src/Render/SalmonRender/SalmonRenderInterface.cpp b/src/Render/SalmonRender/SalmonRenderInterface.cpp index 64bb0f0..035bc39 100644 --- a/src/Render/SalmonRender/SalmonRenderInterface.cpp +++ b/src/Render/SalmonRender/SalmonRenderInterface.cpp @@ -196,7 +196,7 @@ void TSalmonRendererInterface::SetGLCamAngleView() TranslateMatrix(vec3(0.0f, 0.0f, -CamDist)); RotateMatrix(vec4(1.f * sin(CamPhi / 2.f), 0.f, 0.f, 1.f * cos(CamPhi / 2.f))); RotateMatrix(vec4(0.f, 1.f * sin(CamAlpha / 2.f), 0.f, 1.f * cos(CamAlpha / 2.f))); - TranslateMatrix(CamPos); + TranslateMatrix(-CamVec);