|
|
@@ -3,8 +3,8 @@
|
|
|
#include <time.h>
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
-int width = 100;
|
|
|
-int height = 100;
|
|
|
+int width = 200;
|
|
|
+int height = 200;
|
|
|
|
|
|
int main(){
|
|
|
srand(time(NULL));
|
|
|
@@ -33,73 +33,34 @@ int main(){
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
- RI_newObject object_buffer[49] = {
|
|
|
- {0, 0, 50, 0, 0, 0, -9999999, 10, 10, 10, RI_MATERIAL_WIREFRAME | RI_MATERIAL_DOUBLE_SIDED | RI_MATERIAL_HAS_TEXTURE, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {10, 0, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {20, 0, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {30, 0, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-10, 0, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-20, 0, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-30, 0, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {0, 10, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {10, 10, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {20, 10, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {30, 10, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-10, 10, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-20, 10, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-30, 10, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {0, -10, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {10, -10, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {20, -10, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {30, -10, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-10, -10, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-20, -10, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-30, -10, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {0, 20, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {10, 20, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {20, 20, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {30, 20, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-10, 20, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-20, 20, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-30, 20, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {0, -20, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {10, -20, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {20, -20, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {30, -20, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-10, -20, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-20, -20, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-30, -20, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {0, 30, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {10, 30, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {20, 30, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {30, 30, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-10, 30, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-20, 30, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-30, 30, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {0, -30, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {10, -30, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {20, -30, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {30, -30, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-10, -30, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-20, -30, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- {-30, -30, 100, 0, 0, 0, -9999999, 10, 10, 10, RI_PMP_TEXTURED, "objects/rotated_cube.obj", "textures/bill_mcdinner.png"},
|
|
|
- };
|
|
|
+ RI_newObject object_buffer[9] = {
|
|
|
+ {0, 0, 30, 0, 0, 0, 0, 10, 20, 5, RI_PMP_TEXTURED, "objects/cube.obj", "textures/bill_mcdinner.png"},
|
|
|
+ {50, 0, 100, 0, 0, 0, 0, 10, 10, 100, RI_PMP_TEXTURED, "objects/cube.obj", "textures/bill_mcdinner.png"},
|
|
|
+ {-50, 0, 100, 0, 0, 0, 0, 10, 10, 100, RI_PMP_TEXTURED, "objects/cube.obj", "textures/bill_mcdinner.png"},
|
|
|
+ {0, 50, 100, 0, 0, 0, 0, 10, 10, 100, RI_PMP_TEXTURED, "objects/cube.obj", "textures/bill_mcdinner.png"},
|
|
|
+ {0, -50, 100, 0, 0, 0, 0, 10, 10, 100, RI_PMP_TEXTURED, "objects/cube.obj", "textures/bill_mcdinner.png"},
|
|
|
+ {-50, 50, 100, 0, 0, 0, 0, 10, 10, 100, RI_PMP_TEXTURED, "objects/cube.obj", "textures/bill_mcdinner.png"},
|
|
|
+ {-50, -50, 100, 0, 0, 0, 0, 10, 10, 100, RI_PMP_TEXTURED, "objects/cube.obj", "textures/bill_mcdinner.png"},
|
|
|
+ {50, 50, 100, 0, 0, 0, 0, 10, 10, 100, RI_PMP_TEXTURED, "objects/cube.obj", "textures/bill_mcdinner.png"},
|
|
|
+ {50, -50, 100, 0, 0, 0, 0, 10, 10, 100, RI_PMP_TEXTURED, "objects/cube.obj", "textures/bill_mcdinner.png"},
|
|
|
+ };
|
|
|
|
|
|
- int objects_to_request = 1;
|
|
|
+ int objects_to_request = 9;
|
|
|
|
|
|
RI_objects objects = RI_RequestObjects(object_buffer, objects_to_request);
|
|
|
|
|
|
- while (RI_IsRunning() == RI_RUNNING){
|
|
|
for (int i = 0; i < objects_to_request; i++){
|
|
|
- objects[i].transform.rotation.x += 0.01;
|
|
|
- objects[i].transform.rotation.y += 0.02;
|
|
|
- objects[i].transform.rotation.z += 0.03;
|
|
|
-
|
|
|
- objects[i].transform.rotation.x = fmod(objects[i].transform.rotation.x, RI_2PI);
|
|
|
- objects[i].transform.rotation.y = fmod(objects[i].transform.rotation.y, RI_2PI);
|
|
|
- objects[i].transform.rotation.z = fmod(objects[i].transform.rotation.z, RI_2PI);
|
|
|
+ objects[i].material.albedo.a = 255 * ((float)i / objects_to_request);
|
|
|
+ objects[i].material.albedo.r = 255 * ((float)i / objects_to_request);
|
|
|
+ objects[i].material.albedo.g = 255 * ((float)i / objects_to_request);
|
|
|
+ objects[i].material.albedo.b = 255 * ((float)i / objects_to_request);
|
|
|
}
|
|
|
|
|
|
+ while (RI_IsRunning() == RI_RUNNING){
|
|
|
+ objects[0].transform.rotation.x += 0.1;
|
|
|
+ objects[0].transform.rotation.y += 0.1;
|
|
|
+ objects[0].transform.rotation.z += 0.1;
|
|
|
+
|
|
|
RI_Tick();
|
|
|
}
|
|
|
|