|
@@ -150,7 +150,7 @@ void update()
|
|
|
uint32_t i, j;
|
|
|
uint32_t faceCount;
|
|
|
uint32_t timeToWait = FRAME_TARGET_TIME - (SDL_GetTicks() - previousFrameTime);
|
|
|
- matrix4_t scaleMatrix;
|
|
|
+ matrix4_t scaleMatrix, translateMatrix;
|
|
|
if (timeToWait <= FRAME_TARGET_TIME)
|
|
|
{
|
|
|
SDL_Delay(timeToWait);
|
|
@@ -161,11 +161,14 @@ void update()
|
|
|
mesh.rotation.y += 0.01;
|
|
|
mesh.rotation.z += 0.02;
|
|
|
|
|
|
- mesh.scale.x += 0.002;
|
|
|
- mesh.scale.x += 0.001;
|
|
|
+ //mesh.scale.x += 0.002;
|
|
|
+ //mesh.scale.x += 0.001;
|
|
|
|
|
|
- scaleMatrix = mat4Scale(mesh.scale.x, mesh.scale.y, mesh.scale.z);
|
|
|
+ mesh.translation.x += 0.01;
|
|
|
+ mesh.translation.z = 5;
|
|
|
|
|
|
+ scaleMatrix = mat4Scale(mesh.scale.x, mesh.scale.y, mesh.scale.z);
|
|
|
+ translateMatrix = mat4Translate(mesh.translation.x, mesh.translation.y, mesh.translation.z);
|
|
|
arrayEmpty(projectedTriangles);
|
|
|
|
|
|
faceCount = arrayGetSize(mesh.faces);
|
|
@@ -186,8 +189,7 @@ void update()
|
|
|
transformedVertices[j] = vec4FromVec3(vertices[j]);
|
|
|
|
|
|
transformedVertices[j] = mat4ProdVec4(scaleMatrix, transformedVertices[j]);
|
|
|
-
|
|
|
- transformedVertices[j].z += 5;
|
|
|
+ transformedVertices[j] = mat4ProdVec4(translateMatrix, transformedVertices[j]);
|
|
|
}
|
|
|
|
|
|
if (!doNotCull)
|