|
@@ -29,6 +29,12 @@ vec3_t cameraPosition =
|
|
|
.y = 0,
|
|
|
.z = -5,
|
|
|
};
|
|
|
+vec3_t cubeRotation =
|
|
|
+{
|
|
|
+ .x = 0,
|
|
|
+ .y = 0,
|
|
|
+ .z = 0,
|
|
|
+};
|
|
|
|
|
|
double fovFactor = 640 ;
|
|
|
|
|
@@ -113,10 +119,19 @@ vec2_t perspectivePointProjection(vec3_t point)
|
|
|
void update()
|
|
|
{
|
|
|
int i;
|
|
|
+
|
|
|
+ cubeRotation.x += 0.001;
|
|
|
+ cubeRotation.y += 0.001;
|
|
|
+ cubeRotation.z += 0.001;
|
|
|
+
|
|
|
for(i = 0; i < N_POINTS; i++)
|
|
|
{
|
|
|
vec3_t point = cubePoints[i];
|
|
|
|
|
|
+ point = vec3RotateX(point, cubeRotation.x);
|
|
|
+ point = vec3RotateY(point, cubeRotation.y);
|
|
|
+ point = vec3RotateZ(point, cubeRotation.z);
|
|
|
+
|
|
|
point.z -= cameraPosition.z;
|
|
|
|
|
|
projectedPoints[i] = perspectivePointProjection(point);
|