|
@@ -15,7 +15,7 @@ int main(){
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
RI_scene *scene = RI_new_scene();
|
|
RI_scene *scene = RI_new_scene();
|
|
|
- context->debug_flags |= RI_DEBUG_TRANSFORMER_TIME | RI_DEBUG_RASTERIZER_TIME | RI_DEBUG_PITMAP | RI_DEBUG_FRAME_START_END_MARKERS;
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
scene->camera.FOV = 1.5;
|
|
scene->camera.FOV = 1.5;
|
|
|
scene->camera.min_clip = 0.1;
|
|
scene->camera.min_clip = 0.1;
|
|
@@ -27,14 +27,16 @@ int main(){
|
|
|
RI_mesh *gordon_mesh = RI_load_mesh("objects/terrain.obj");
|
|
RI_mesh *gordon_mesh = RI_load_mesh("objects/terrain.obj");
|
|
|
RI_mesh *gordon_head_mesh = RI_load_mesh("objects/gordon_freeman_head.obj");
|
|
RI_mesh *gordon_head_mesh = RI_load_mesh("objects/gordon_freeman_head.obj");
|
|
|
RI_mesh *text_mesh = RI_load_mesh("objects/gordon_freeman.obj");
|
|
RI_mesh *text_mesh = RI_load_mesh("objects/gordon_freeman.obj");
|
|
|
- RI_mesh *plane_mesh = RI_load_mesh("objects/plane_subdivided.obj");
|
|
|
|
|
|
|
+ RI_mesh *plane_mesh = RI_load_mesh("objects/plane.obj");
|
|
|
|
|
|
|
|
scene->actors = malloc(sizeof(RI_actor) * 5);
|
|
scene->actors = malloc(sizeof(RI_actor) * 5);
|
|
|
|
|
|
|
|
- RI_texture* skybox_texture = RI_load_image("textures/alley_skybox_3072x3072.bmp");
|
|
|
|
|
|
|
+ RI_texture* skybox_texture = RI_load_animation("textures/emoji_angry.bmp", 40);
|
|
|
RI_texture* gordon_texture = RI_load_image("textures/terrain_texture.bmp");
|
|
RI_texture* gordon_texture = RI_load_image("textures/terrain_texture.bmp");
|
|
|
RI_texture* gordon_face_texture = RI_load_animation("textures/gordon_face_animated.bmp", 3);
|
|
RI_texture* gordon_face_texture = RI_load_animation("textures/gordon_face_animated.bmp", 3);
|
|
|
RI_texture* emoji_texture = RI_load_image("textures/gordon_body.bmp");
|
|
RI_texture* emoji_texture = RI_load_image("textures/gordon_body.bmp");
|
|
|
|
|
+ RI_texture* iver_texture = RI_load_animation("textures/emoji_gif.bmp", 11);
|
|
|
|
|
+ RI_texture* sky_texture = RI_load_image("textures/skybox_texture_4_cube_1024x1024.bmp");
|
|
|
|
|
|
|
|
scene->actors[0] = RI_new_actor();
|
|
scene->actors[0] = RI_new_actor();
|
|
|
scene->actors[1] = RI_new_actor();
|
|
scene->actors[1] = RI_new_actor();
|
|
@@ -44,22 +46,16 @@ int main(){
|
|
|
|
|
|
|
|
context->window.aspect_mode = RI_ASPECT_MODE_LETTERBOX;
|
|
context->window.aspect_mode = RI_ASPECT_MODE_LETTERBOX;
|
|
|
|
|
|
|
|
- scene->actors[0]->mesh = skybox_mesh;
|
|
|
|
|
- scene->actors[0]->texture = skybox_texture;
|
|
|
|
|
- scene->actors[0]->scale = (RI_vector_3){1000, 1000, 1000};
|
|
|
|
|
- scene->actors[0]->position = (RI_vector_3){0, 0, 300};
|
|
|
|
|
-scene->actors[0]->active = 0;
|
|
|
|
|
-
|
|
|
|
|
- scene->actors[1]->mesh = gordon_head_mesh;
|
|
|
|
|
- scene->actors[1]->texture = gordon_face_texture;
|
|
|
|
|
- scene->actors[1]->scale = (RI_vector_3){3, 1, 3};
|
|
|
|
|
- scene->actors[1]->position = (RI_vector_3){0, 900, -400};
|
|
|
|
|
|
|
+ scene->actors[1]->mesh = skybox_mesh;
|
|
|
|
|
+ scene->actors[1]->texture = sky_texture;
|
|
|
|
|
+ scene->actors[1]->scale = (RI_vector_3){1000, 1000, 1000};
|
|
|
|
|
+ scene->actors[1]->position = (RI_vector_3){0, 0, 0};
|
|
|
// scene->actors[1]->active = 0;
|
|
// scene->actors[1]->active = 0;
|
|
|
|
|
|
|
|
- scene->actors[2]->mesh = gordon_mesh;
|
|
|
|
|
|
|
+ scene->actors[2]->mesh = plane_mesh;//gordon_mesh;
|
|
|
scene->actors[2]->texture = gordon_texture;
|
|
scene->actors[2]->texture = gordon_texture;
|
|
|
scene->actors[2]->scale = (RI_vector_3){2000, 1000, 2000};
|
|
scene->actors[2]->scale = (RI_vector_3){2000, 1000, 2000};
|
|
|
- scene->actors[2]->position = (RI_vector_3){0, -150, 0};
|
|
|
|
|
|
|
+ scene->actors[2]->position = (RI_vector_3){0, -30, 0};
|
|
|
// scene->actors[2]->active = 0;
|
|
// scene->actors[2]->active = 0;
|
|
|
|
|
|
|
|
scene->actors[3]->mesh = text_mesh;
|
|
scene->actors[3]->mesh = text_mesh;
|
|
@@ -68,20 +64,23 @@ scene->actors[0]->active = 0;
|
|
|
scene->actors[3]->position = (RI_vector_3){0, 900, -400};
|
|
scene->actors[3]->position = (RI_vector_3){0, 900, -400};
|
|
|
// scene->actors[3]->active = 0;
|
|
// scene->actors[3]->active = 0;
|
|
|
|
|
|
|
|
|
|
+ float scale = 30;
|
|
|
|
|
+
|
|
|
|
|
+ scene->actors[0]->mesh = plane_mesh;
|
|
|
|
|
+ scene->actors[0]->texture = skybox_texture;
|
|
|
|
|
+ scene->actors[0]->scale = (RI_vector_3){scale * 1.261904762, scale, scale};
|
|
|
|
|
+ scene->actors[0]->position = (RI_vector_3){60, 0, 180};
|
|
|
|
|
+
|
|
|
scene->actors[4]->mesh = plane_mesh;
|
|
scene->actors[4]->mesh = plane_mesh;
|
|
|
- scene->actors[4]->texture = emoji_texture;
|
|
|
|
|
- scene->actors[4]->scale = (RI_vector_3){100, 50, 30};
|
|
|
|
|
|
|
+ scene->actors[4]->texture = iver_texture;
|
|
|
|
|
+ scene->actors[4]->scale = (RI_vector_3){scale, scale, scale};
|
|
|
scene->actors[4]->position = (RI_vector_3){60, 40, 180};
|
|
scene->actors[4]->position = (RI_vector_3){60, 40, 180};
|
|
|
-scene->actors[4]->active = 0;
|
|
|
|
|
|
|
+// scene->actors[4]->active = 0;
|
|
|
|
|
|
|
|
- RI_euler_rotation_to_quaternion(&scene->actors[0]->rotation, (RI_vector_3){0, 0, 0});
|
|
|
|
|
|
|
+ RI_euler_rotation_to_quaternion(&scene->actors[0]->rotation, (RI_vector_3){3.14159 / 2, 0.3, 0});
|
|
|
// RI_euler_rotation_to_quaternion(&scene->actors[1]->rotation, (RI_vector_3){0, 3.14159, 0});
|
|
// RI_euler_rotation_to_quaternion(&scene->actors[1]->rotation, (RI_vector_3){0, 3.14159, 0});
|
|
|
RI_euler_rotation_to_quaternion(&scene->actors[2]->rotation, (RI_vector_3){0, 0.78539816339, 0});
|
|
RI_euler_rotation_to_quaternion(&scene->actors[2]->rotation, (RI_vector_3){0, 0.78539816339, 0});
|
|
|
|
|
|
|
|
- scene->camera.position = (RI_vector_3){0, 1000, -500};
|
|
|
|
|
-
|
|
|
|
|
- RI_euler_rotation_to_quaternion(&scene->camera.rotation, (RI_vector_3){-.7, 0, 0});
|
|
|
|
|
-
|
|
|
|
|
scene->length_of_actors_array = 5;
|
|
scene->length_of_actors_array = 5;
|
|
|
|
|
|
|
|
long int start, end;
|
|
long int start, end;
|
|
@@ -95,19 +94,29 @@ scene->actors[4]->active = 0;
|
|
|
|
|
|
|
|
double rotation = 0;
|
|
double rotation = 0;
|
|
|
|
|
|
|
|
|
|
+ float animation_frame = 0;
|
|
|
|
|
+
|
|
|
while (context->is_running){
|
|
while (context->is_running){
|
|
|
start = clock();
|
|
start = clock();
|
|
|
|
|
|
|
|
// scene->camera.FOV = context->current_frame;
|
|
// scene->camera.FOV = context->current_frame;
|
|
|
|
|
|
|
|
- scene->actors[1]->texture_frame++;
|
|
|
|
|
|
|
+ scene->actors[4]->texture_frame = rotation * 20;
|
|
|
|
|
+ scene->actors[0]->texture_frame = rotation * 15;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ RI_euler_rotation_to_quaternion(&scene->actors[4]->rotation, (RI_vector_3){3.14159 / 2, -fabs(fmod(rotation, 3.14159)) + -3.14159 / 2, 0});
|
|
|
|
|
|
|
|
- // RI_euler_rotation_to_quaternion(&scene->camera.rotation, (RI_vector_3){0, .7 + rotation / 10, 0});
|
|
|
|
|
- RI_euler_rotation_to_quaternion(&scene->actors[1]->rotation, (RI_vector_3){0, rotation / 4, 0.7});
|
|
|
|
|
RI_euler_rotation_to_quaternion(&scene->actors[3]->rotation, (RI_vector_3){0, rotation / 4, 0.7});
|
|
RI_euler_rotation_to_quaternion(&scene->actors[3]->rotation, (RI_vector_3){0, rotation / 4, 0.7});
|
|
|
// scene->actors[2]->position.z += delta_time;
|
|
// scene->actors[2]->position.z += delta_time;
|
|
|
|
|
|
|
|
- rotation += delta_time;
|
|
|
|
|
|
|
+ scene->actors[4]->position = (RI_vector_3){cos(fmod(rotation, 3.14159)) * 200, 0, sin(fmod(rotation, 3.14159)) * 200};
|
|
|
|
|
+
|
|
|
|
|
+ scene->actors[0]->position = (RI_vector_3){60, fabs(sin(fabs(rotation) * 6)) * 10, 180};
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ rotation += delta_time * .7;
|
|
|
|
|
|
|
|
RI_render(scene);
|
|
RI_render(scene);
|
|
|
|
|
|