diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | cel.fs | 110 | ||||
-rw-r--r-- | demo.c | 122 | ||||
-rw-r--r-- | demo.vs | 14 | ||||
-rw-r--r-- | include/common.h | 2 | ||||
-rw-r--r-- | include/honey.h | 1 | ||||
-rw-r--r-- | include/light.h | 33 | ||||
-rw-r--r-- | include/shader.h | 21 | ||||
-rw-r--r-- | sphere-tex.png | bin | 0 -> 55783 bytes | |||
-rw-r--r-- | sphere-tex.xcf | bin | 0 -> 386241 bytes | |||
-rw-r--r-- | sphere.mtl | 13 | ||||
-rw-r--r-- | sphere.obj | 855 | ||||
-rw-r--r-- | sphere.png | bin | 0 -> 82423 bytes | |||
-rw-r--r-- | src/light.c | 20 | ||||
-rw-r--r-- | src/shader.c | 57 |
15 files changed, 1176 insertions, 74 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b48428d..41cb559 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ add_executable(honey_engine_demo demo.c) set(CMAKE_C_FLAGS "-g") -add_library(honey src/honey.c src/camera.c src/error.c src/input.c src/mesh.c src/model.c src/primitives.c src/shader.c src/texture.c) +add_library(honey src/honey.c src/camera.c src/error.c src/input.c src/light.c src/mesh.c src/model.c src/primitives.c src/shader.c src/texture.c) add_library(glad src/glad.c) add_library(stb_image src/stb_image.c) @@ -0,0 +1,110 @@ +#version 330 core + +/* input from the vector shader */ +in vec3 in_normal; +in vec2 in_texture_coordinate; +in vec3 in_fragment_position; + +/* light uniforms */ +uniform vec3 ambient_color; + +struct point_light { + vec3 position; /* view position */ + + float constant; + float linear; + float quadratic; + + vec3 color; +}; + +struct directional_light { + vec3 direction; + vec3 color; +}; + +#define MAX_POINT_LIGHTS 8 +#define MAX_DIRECTIONAL_LIGHTS 8 + +uniform point_light point_lights[MAX_POINT_LIGHTS]; +uniform int n_point_lights; + +uniform directional_light directional_lights[MAX_DIRECTIONAL_LIGHTS]; +uniform int n_directional_lights; + +/* texture uniforms */ +uniform sampler2D tex; + +/* view matrix */ +uniform mat4 view; + +out vec4 fragment_color; + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +/* compute phong cel-shader intensity */ +float compute_light_intensity(vec3 normal, vec3 light_direction, vec3 view_direction) { + /* diffuse light */ + float diffuse_intensity = max(dot(normal, light_direction), 0); + diffuse_intensity = smoothstep(0, 0.01, diffuse_intensity); + + /* specular highlight */ + vec3 reflection_direction = reflect(-light_direction, normal); + float specular_intensity = pow(max(dot(view_direction, reflection_direction), 0), 256); + specular_intensity = smoothstep(0.005, 0.01, specular_intensity); + + return diffuse_intensity + specular_intensity; +} + +/* compute directional light contribution */ +vec3 compute_directional_light(directional_light light, vec3 normal, vec3 view_direction) { + vec3 light_direction = -vec3(view * vec4(light.direction.xyz, 0.0)); + return light.color * compute_light_intensity(normal, light_direction, view_direction); +} + +/* compute point light contribution */ +vec3 compute_point_light(point_light light, vec3 normal, vec3 fragment_position, vec3 view_direction) { + vec3 light_position = vec3(view * vec4(light.position.xyz, 1.0)); + vec3 light_direction = normalize(light_position - fragment_position); + + float light_intensity = compute_light_intensity(normal, light_direction, view_direction); + + /* attenuation */ + float distance = length(light_position - fragment_position); + float attenuation = 1.0 / (light.constant + + light.linear * distance + + light.quadratic * distance * distance); + + return attenuation * light.color * light_intensity; +} + +void main() +{ + vec3 normal = normalize(in_normal); + vec3 view_direction = normalize(-in_fragment_position); + + vec3 point_light_contrib = vec3(0, 0, 0); + for (int i=0; i<n_point_lights; i++) { + point_light_contrib += compute_point_light(point_lights[i], + normal, + in_fragment_position, + view_direction); + } + + vec3 directional_light_contrib = vec3(0,0,0); + for (int i=0; i<n_directional_lights; i++) { + directional_light_contrib += compute_directional_light(directional_lights[i], + normal, + view_direction); + } + + /* rim lighting */ + /*float rim_amount = 0.716; + float rim_threshold = 0.5; + float rim_norm = 1 - dot(normal, view_direction); + rim_intensity = smoothstep(rim_amount - 0.01, rim_amount + 0.01, rim_intensity); + vec3 rim_light = rim_intensity * ambient_color;*/ + + vec4 total_light = vec4((ambient_color + point_light_contrib + directional_light_contrib).xyz, 1.0); + fragment_color = total_light * texture(tex, in_texture_coordinate); +} @@ -10,16 +10,12 @@ float cameraSpeed = 3.0; float camera_roll_speed = 1.0; const float cameraMouseSensitivity = 0.1; -honey_mesh cube; -mat4 model; -honey_shader cube_shader; -honey_texture container; -honey_texture happy_face; - honey_mesh light_cube; -vec3 ambient_color = { 0, 0.2, 0.2 }; -vec3 light_color = { 1, 1, 1 }; -vec3 light_position = { 2, 2, 2 }; +vec3 ambient_color = { 0.3, 0.3, 0.3 }; +honey_point_light light; + +honey_directional_light sun; + mat4 light_model; honey_shader light_shader; @@ -27,6 +23,11 @@ honey_model suzanne; mat4 suzanne_model; honey_texture suzanne_tex; +honey_model sphere; +honey_shader sphere_shader; +mat4 model; +honey_texture sphere_tex; + bool wireframe = false; /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ @@ -76,8 +77,6 @@ void toggle_wireframe(void* data, int action) { void update(float dt) { glfwPollEvents(); - //glm_rotate_x(model, glm_rad(10*dt), model); - if (honey_key_down(HONEY_KEY_ESCAPE)) { glfwSetWindowShouldClose(window, true); } @@ -118,23 +117,22 @@ void draw() { } honey_camera_calculate_view(&camera); - honey_shader_set_mat4(cube_shader, "view", camera.view); - honey_shader_set_mat4(cube_shader, "model", model); + honey_shader_set_mat4(sphere_shader, "view", camera.view); + honey_shader_set_mat4(sphere_shader, "model", model); mat4 normal4; mat3 normal; glm_mat4_copy(model, normal4); glm_mat4_inv_fast(normal4, normal4); glm_mat4_pick3t(normal4, normal); - honey_shader_set_mat3(cube_shader, "normal_mat", normal); + honey_shader_set_mat3(sphere_shader, "normal_mat", normal); honey_shader_set_mat4(light_shader, "view", camera.view); honey_shader_set_mat4(light_shader, "model", light_model); - honey_texture_use(suzanne_tex, 0); - honey_texture_use(happy_face, 1); + honey_texture_use(sphere_tex, 0); - //honey_mesh_draw(cube, cube_shader); - honey_model_draw(&suzanne, cube_shader); + //honey_mesh_draw(cube, sphere_shader); + honey_model_draw(&sphere, sphere_shader); honey_mesh_draw(light_cube, light_shader); glfwSwapBuffers(window); @@ -150,19 +148,11 @@ int main() { honey_key_bind(HONEY_KEY_F, toggle_wireframe, NULL); - /* load container texture */ - if (honey_texture_new(&container, "container.jpg", false) != TEXTURE_OK) { - return 1; - } - - /* load happy face texture */ - if (honey_texture_new(&happy_face, "happy.png", true) != TEXTURE_OK) { - return 1; - } - - honey_texture_new(&suzanne_tex, "Suzanne-tex.png", true); + /* load model */ + honey_texture_new(&sphere_tex, "sphere-tex.png", true); + honey_model_load(&sphere, "sphere.obj"); - honey_error result = honey_shader_load(&cube_shader, "demo.vs", "demo.fs"); + honey_error result = honey_shader_load(&sphere_shader, "demo.vs", "cel.fs"); if (result != HONEY_OK) { char error_message[3*HONEY_ERROR_DATA_STRING_LENGTH]; honey_human_readable_error(error_message, result); @@ -170,29 +160,17 @@ int main() { return 1; } - if (honey_shader_load(&light_shader, "light.vs", "light.fs") != HONEY_OK) { - return 1; - } + honey_shader_load(&light_shader, "light.vs", "light.fs"); - if (honey_mesh_new_textured_cube(&cube, 1, 1, 1) != MESH_OK) { - fprintf(stderr, "Failed to load cube\n"); - return 1; - } + honey_mesh_new_cube(&light_cube, 0.1,0.1,0.1); - if (honey_mesh_new_cube(&light_cube, 0.1, 0.1, 0.1) != MESH_OK) { - return 1; - } + sun.direction[0] = 0; + sun.direction[1] = -1; + sun.direction[0] = 0; - result = honey_model_load(&suzanne, "Suzanne.obj"); - if (result != HONEY_OK) { - char error_message[3*HONEY_ERROR_DATA_STRING_LENGTH]; - honey_human_readable_error(error_message, result); - fprintf(stderr, "%s\n", error_message); - return 1; - } - - glm_mat4_identity(light_model); - glm_translate(light_model, light_position); + sun.color[0] = 1; + sun.color[1] = 1; + sun.color[2] = 1; glm_mat4_identity(model); @@ -208,25 +186,37 @@ int main() { camera_aspect_ratio, camera_near, camera_far, camera_fov); - /* set cube_shader uniforms */ - honey_shader_set_int(cube_shader, "box_texture", 0); - honey_shader_set_int(cube_shader, "happy_texture", 1); - honey_shader_set_vec3(cube_shader, "light_color", light_color); - honey_shader_set_vec3(cube_shader, "light_position", light_position); - honey_shader_set_vec3(cube_shader, "ambient_color", ambient_color); - - honey_shader_set_mat4(cube_shader, "model", model); + + /* set sphere_shader uniforms */ + honey_shader_set_int(sphere_shader, "tex", 0); + + honey_shader_set_int (sphere_shader, "n_point_lights", 1); + honey_shader_set_int (sphere_shader, "n_directional_lights", 1); + + honey_point_light_new(&light, + 2, 2, 2, /* position */ + 1, 1, 1, /* color */ + 1, 0, 0); /* attenuation */ + + glm_mat4_identity(light_model); + glm_translate(light_model, light.position); + + honey_shader_set_point_light(sphere_shader, 0, light); + honey_shader_set_directional_light(sphere_shader, 0, sun); + honey_shader_set_vec3(sphere_shader, "ambient_color", ambient_color); + + honey_shader_set_mat4(sphere_shader, "model", model); mat4 normal4; mat3 normal; glm_mat4_copy(model, normal4); glm_mat4_inv_fast(normal4, normal4); glm_mat4_pick3t(normal4, normal); - honey_shader_set_mat3(cube_shader, "normal_mat", normal); - honey_shader_set_mat4(cube_shader, "view", camera.view); - honey_shader_set_mat4(cube_shader, "projection", camera.projection); + honey_shader_set_mat3(sphere_shader, "normal_mat", normal); + honey_shader_set_mat4(sphere_shader, "view", camera.view); + honey_shader_set_mat4(sphere_shader, "projection", camera.projection); /* set light_shader uniforms */ - honey_shader_set_vec3(light_shader, "light_color", light_color); + honey_shader_set_vec3(light_shader, "light_color", light.color); honey_shader_set_mat4(light_shader, "model", light_model); honey_shader_set_mat4(light_shader, "view", camera.view); @@ -241,9 +231,11 @@ int main() { honey_run(window); - honey_mesh_delete(cube); - honey_model_delete(&suzanne); - honey_shader_delete(cube_shader); + honey_model_delete(&sphere); + honey_shader_delete(sphere_shader); + + honey_mesh_delete(light_cube); + honey_shader_delete(light_shader); honey_quit(); @@ -1,11 +1,11 @@ #version 330 core layout (location = 0) in vec3 position; -layout (location = 1) in vec3 in_normal; +layout (location = 1) in vec3 normal; layout (location = 2) in vec2 texCoord; -out vec2 texture_coordinate; -out vec3 normal; -out vec3 fragment_position; +out vec2 in_texture_coordinate; +out vec3 in_normal; +out vec3 in_fragment_position; uniform mat4 model; uniform mat3 normal_mat; @@ -15,7 +15,7 @@ uniform mat4 projection; void main() { gl_Position = projection * view * model * vec4(position.xyz, 1.0); - texture_coordinate = texCoord; - normal = mat3(view) * normal_mat * in_normal; - fragment_position = vec3(view * model * vec4(position.xyz, 1.0)); + in_texture_coordinate = texCoord; + in_normal = mat3(view) * normal_mat * normal; + in_fragment_position = vec3(view * model * vec4(position.xyz, 1.0)); }
\ No newline at end of file diff --git a/include/common.h b/include/common.h index 83934ac..680f097 100644 --- a/include/common.h +++ b/include/common.h @@ -42,7 +42,7 @@ typedef enum { HONEY_N_ERRORS } honey_error; -#define HONEY_ERROR_DATA_STRING_LENGTH 512 +#define HONEY_ERROR_DATA_STRING_LENGTH 4096 static struct { char string1[HONEY_ERROR_DATA_STRING_LENGTH]; diff --git a/include/honey.h b/include/honey.h index 1d45195..77dd678 100644 --- a/include/honey.h +++ b/include/honey.h @@ -9,6 +9,7 @@ #include "camera.h" #include "common.h" #include "input.h" +#include "light.h" #include "mesh.h" #include "model.h" #include "primitives.h" diff --git a/include/light.h b/include/light.h new file mode 100644 index 0000000..93fcfd1 --- /dev/null +++ b/include/light.h @@ -0,0 +1,33 @@ +#ifndef HONEY_LIGHT_H +#define HONEY_LIGHT_H + +#include "common.h" + +#define HONEY_MAX_LIGHT_NAME_LENGTH 64 + +typedef struct { + vec3 position; + vec3 color; + + float constant; + float linear; + float quadratic; +} honey_point_light; + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +typedef struct { + vec3 direction; + vec3 color; +} honey_directional_light; + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +void honey_point_light_new(honey_point_light* light, + float x, float y, float z, + float r, float g, float b, + float constant, + float linear, + float quadratic); + +#endif diff --git a/include/shader.h b/include/shader.h index 9a567f5..b502137 100644 --- a/include/shader.h +++ b/include/shader.h @@ -7,6 +7,7 @@ #define HONEY_SHADER_H #include "common.h" +#include "light.h" typedef int honey_shader; @@ -85,6 +86,26 @@ void honey_shader_set_mat4(honey_shader shader, char* matrix_name, mat4 value); +/** @brief Set a point_light uniform. + * + * @param[in] shader The shader to which the uniform belongs + * @param[in] point_light_index The index of the light to set + * @param[in] light The honey_point_light to set + */ +void honey_shader_set_point_light(honey_shader shader, + int point_light_index, + honey_point_light light); + +/** @brief Set a directional_light uniform. + * + * @param[in] shader The shader to which the uniform belongs + * @param[in] directional_light_index The index of the light to set + * @param[in] light The honey_directional_light to set + */ +void honey_shader_set_directional_light(honey_shader shader, + int directional_light_index, + honey_directional_light light); + /** @brief Use a shader. */ #define honey_shader_use glUseProgram diff --git a/sphere-tex.png b/sphere-tex.png Binary files differnew file mode 100644 index 0000000..1d12d94 --- /dev/null +++ b/sphere-tex.png diff --git a/sphere-tex.xcf b/sphere-tex.xcf Binary files differnew file mode 100644 index 0000000..01b0d9f --- /dev/null +++ b/sphere-tex.xcf diff --git a/sphere.mtl b/sphere.mtl new file mode 100644 index 0000000..7e07cb8 --- /dev/null +++ b/sphere.mtl @@ -0,0 +1,13 @@ +# Blender MTL File: 'None' +# Material Count: 1 + +newmtl Material.002 +Ns 225.000000 +Ka 1.000000 1.000000 1.000000 +Kd 0.800000 0.800000 0.800000 +Ks 0.500000 0.500000 0.500000 +Ke 0.000000 0.000000 0.000000 +Ni 1.450000 +d 1.000000 +illum 2 +map_Kd sphere-tex.png diff --git a/sphere.obj b/sphere.obj new file mode 100644 index 0000000..eaa13c6 --- /dev/null +++ b/sphere.obj @@ -0,0 +1,855 @@ +# Blender v2.82 (sub 7) OBJ File: '' +# www.blender.org +mtllib sphere.mtl +o Icosphere +v 0.000000 -1.000000 0.000000 +v 0.723607 -0.447220 0.525725 +v -0.276388 -0.447220 0.850649 +v -0.894426 -0.447216 0.000000 +v -0.276388 -0.447220 -0.850649 +v 0.723607 -0.447220 -0.525725 +v 0.276388 0.447220 0.850649 +v -0.723607 0.447220 0.525725 +v -0.723607 0.447220 -0.525725 +v 0.276388 0.447220 -0.850649 +v 0.894426 0.447216 0.000000 +v 0.000000 1.000000 0.000000 +v -0.232822 -0.657519 0.716563 +v -0.162456 -0.850654 0.499995 +v -0.077607 -0.967950 0.238853 +v 0.203181 -0.967950 0.147618 +v 0.425323 -0.850654 0.309011 +v 0.609547 -0.657519 0.442856 +v 0.531941 -0.502302 0.681712 +v 0.262869 -0.525738 0.809012 +v -0.029639 -0.502302 0.864184 +v 0.812729 -0.502301 -0.295238 +v 0.850648 -0.525736 0.000000 +v 0.812729 -0.502301 0.295238 +v 0.203181 -0.967950 -0.147618 +v 0.425323 -0.850654 -0.309011 +v 0.609547 -0.657519 -0.442856 +v -0.753442 -0.657515 0.000000 +v -0.525730 -0.850652 0.000000 +v -0.251147 -0.967949 0.000000 +v -0.483971 -0.502302 0.716565 +v -0.688189 -0.525736 0.499997 +v -0.831051 -0.502299 0.238853 +v -0.232822 -0.657519 -0.716563 +v -0.162456 -0.850654 -0.499995 +v -0.077607 -0.967950 -0.238853 +v -0.831051 -0.502299 -0.238853 +v -0.688189 -0.525736 -0.499997 +v -0.483971 -0.502302 -0.716565 +v -0.029639 -0.502302 -0.864184 +v 0.262869 -0.525738 -0.809012 +v 0.531941 -0.502302 -0.681712 +v 0.956626 0.251149 0.147618 +v 0.951058 -0.000000 0.309013 +v 0.860698 -0.251151 0.442858 +v 0.860698 -0.251151 -0.442858 +v 0.951058 0.000000 -0.309013 +v 0.956626 0.251149 -0.147618 +v 0.155215 0.251152 0.955422 +v 0.000000 -0.000000 1.000000 +v -0.155215 -0.251152 0.955422 +v 0.687159 -0.251152 0.681715 +v 0.587786 0.000000 0.809017 +v 0.436007 0.251152 0.864188 +v -0.860698 0.251151 0.442858 +v -0.951058 -0.000000 0.309013 +v -0.956626 -0.251149 0.147618 +v -0.436007 -0.251152 0.864188 +v -0.587786 0.000000 0.809017 +v -0.687159 0.251152 0.681715 +v -0.687159 0.251152 -0.681715 +v -0.587786 -0.000000 -0.809017 +v -0.436007 -0.251152 -0.864188 +v -0.956626 -0.251149 -0.147618 +v -0.951058 0.000000 -0.309013 +v -0.860698 0.251151 -0.442858 +v 0.436007 0.251152 -0.864188 +v 0.587786 -0.000000 -0.809017 +v 0.687159 -0.251152 -0.681715 +v -0.155215 -0.251152 -0.955422 +v 0.000000 0.000000 -1.000000 +v 0.155215 0.251152 -0.955422 +v 0.831051 0.502299 0.238853 +v 0.688189 0.525736 0.499997 +v 0.483971 0.502302 0.716565 +v 0.029639 0.502302 0.864184 +v -0.262869 0.525738 0.809012 +v -0.531941 0.502302 0.681712 +v -0.812729 0.502301 0.295238 +v -0.850648 0.525736 0.000000 +v -0.812729 0.502301 -0.295238 +v -0.531941 0.502302 -0.681712 +v -0.262869 0.525738 -0.809012 +v 0.029639 0.502302 -0.864184 +v 0.483971 0.502302 -0.716565 +v 0.688189 0.525736 -0.499997 +v 0.831051 0.502299 -0.238853 +v 0.077607 0.967950 0.238853 +v 0.162456 0.850654 0.499995 +v 0.232822 0.657519 0.716563 +v 0.753442 0.657515 0.000000 +v 0.525730 0.850652 0.000000 +v 0.251147 0.967949 0.000000 +v -0.203181 0.967950 0.147618 +v -0.425323 0.850654 0.309011 +v -0.609547 0.657519 0.442856 +v -0.203181 0.967950 -0.147618 +v -0.425323 0.850654 -0.309011 +v -0.609547 0.657519 -0.442856 +v 0.077607 0.967950 -0.238853 +v 0.162456 0.850654 -0.499995 +v 0.232822 0.657519 -0.716563 +v 0.361800 0.894429 -0.262863 +v 0.638194 0.723610 -0.262864 +v 0.447209 0.723612 -0.525728 +v -0.138197 0.894430 -0.425319 +v -0.052790 0.723612 -0.688185 +v -0.361804 0.723612 -0.587778 +v -0.447210 0.894429 0.000000 +v -0.670817 0.723611 -0.162457 +v -0.670817 0.723611 0.162457 +v -0.138197 0.894430 0.425319 +v -0.361804 0.723612 0.587778 +v -0.052790 0.723612 0.688185 +v 0.361800 0.894429 0.262863 +v 0.447209 0.723612 0.525728 +v 0.638194 0.723610 0.262864 +v 0.861804 0.276396 -0.425322 +v 0.809019 0.000000 -0.587782 +v 0.670821 0.276397 -0.688189 +v -0.138199 0.276397 -0.951055 +v -0.309016 -0.000000 -0.951057 +v -0.447215 0.276397 -0.850649 +v -0.947213 0.276396 -0.162458 +v -1.000000 0.000001 0.000000 +v -0.947213 0.276397 0.162458 +v -0.447216 0.276397 0.850648 +v -0.309017 -0.000001 0.951056 +v -0.138199 0.276397 0.951055 +v 0.670820 0.276396 0.688190 +v 0.809019 -0.000002 0.587783 +v 0.861804 0.276394 0.425323 +v 0.309017 -0.000000 -0.951056 +v 0.447216 -0.276398 -0.850648 +v 0.138199 -0.276398 -0.951055 +v -0.809018 -0.000000 -0.587783 +v -0.670819 -0.276397 -0.688191 +v -0.861803 -0.276396 -0.425324 +v -0.809018 0.000000 0.587783 +v -0.861803 -0.276396 0.425324 +v -0.670819 -0.276397 0.688191 +v 0.309017 0.000000 0.951056 +v 0.138199 -0.276398 0.951055 +v 0.447216 -0.276398 0.850648 +v 1.000000 0.000000 0.000000 +v 0.947213 -0.276396 0.162458 +v 0.947213 -0.276396 -0.162458 +v 0.361803 -0.723612 -0.587779 +v 0.138197 -0.894429 -0.425321 +v 0.052789 -0.723611 -0.688186 +v -0.447211 -0.723612 -0.525727 +v -0.361801 -0.894429 -0.262863 +v -0.638195 -0.723609 -0.262863 +v -0.638195 -0.723609 0.262864 +v -0.361801 -0.894428 0.262864 +v -0.447211 -0.723610 0.525729 +v 0.670817 -0.723611 -0.162457 +v 0.670818 -0.723610 0.162458 +v 0.447211 -0.894428 0.000001 +v 0.052790 -0.723612 0.688185 +v 0.138199 -0.894429 0.425321 +v 0.361805 -0.723611 0.587779 +vt 0.818181 0.000000 +vt 0.795454 0.039365 +vt 0.840908 0.039365 +vt 0.727272 0.157461 +vt 0.704545 0.118096 +vt 0.681817 0.157461 +vt 0.090909 0.000000 +vt 0.068182 0.039365 +vt 0.113636 0.039365 +vt 0.272727 0.000000 +vt 0.250000 0.039365 +vt 0.295454 0.039365 +vt 0.454545 0.000000 +vt 0.431818 0.039365 +vt 0.477272 0.039365 +vt 0.704545 0.196826 +vt 0.909090 0.157461 +vt 0.863635 0.157461 +vt 0.886363 0.196826 +vt 0.181818 0.157461 +vt 0.136363 0.157461 +vt 0.159091 0.196826 +vt 0.363636 0.157461 +vt 0.318181 0.157461 +vt 0.340909 0.196826 +vt 0.545454 0.157461 +vt 0.500000 0.157461 +vt 0.522727 0.196826 +vt 0.749999 0.196826 +vt 0.931817 0.196826 +vt 0.204545 0.196826 +vt 0.386363 0.196826 +vt 0.568181 0.196826 +vt 0.818181 0.314921 +vt 0.772727 0.314921 +vt 0.795454 0.354286 +vt 1.000000 0.314921 +vt 0.954545 0.314921 +vt 0.977272 0.354286 +vt 0.272727 0.314921 +vt 0.227273 0.314921 +vt 0.250000 0.354286 +vt 0.454545 0.314921 +vt 0.409091 0.314921 +vt 0.431818 0.354286 +vt 0.636363 0.314921 +vt 0.590909 0.314921 +vt 0.613636 0.354286 +vt 0.568181 0.433017 +vt 0.522727 0.433017 +vt 0.545454 0.472382 +vt 0.590909 0.393651 +vt 0.545454 0.393651 +vt 0.568181 0.354286 +vt 0.499999 0.393651 +vt 0.522727 0.354286 +vt 0.477272 0.354286 +vt 0.545454 0.314921 +vt 0.499999 0.314921 +vt 0.386363 0.433017 +vt 0.340909 0.433017 +vt 0.363636 0.472382 +vt 0.409090 0.393651 +vt 0.363636 0.393651 +vt 0.386363 0.354286 +vt 0.318181 0.393651 +vt 0.340909 0.354286 +vt 0.295454 0.354286 +vt 0.363636 0.314921 +vt 0.318182 0.314921 +vt 0.204545 0.433017 +vt 0.159091 0.433017 +vt 0.181818 0.472382 +vt 0.227272 0.393651 +vt 0.181818 0.393651 +vt 0.204545 0.354286 +vt 0.136363 0.393651 +vt 0.159091 0.354286 +vt 0.113636 0.354286 +vt 0.181818 0.314921 +vt 0.136364 0.314921 +vt 0.090909 0.314921 +vt 0.931817 0.433017 +vt 0.886363 0.433017 +vt 0.909090 0.472382 +vt 0.954545 0.393651 +vt 0.909090 0.393651 +vt 0.931818 0.354286 +vt 0.863635 0.393651 +vt 0.886363 0.354286 +vt 0.840908 0.354286 +vt 0.909090 0.314921 +vt 0.863636 0.314921 +vt 0.749999 0.433017 +vt 0.704545 0.433017 +vt 0.727272 0.472382 +vt 0.772726 0.393651 +vt 0.727272 0.393651 +vt 0.749999 0.354286 +vt 0.681817 0.393651 +vt 0.704545 0.354286 +vt 0.659090 0.354286 +vt 0.727272 0.314921 +vt 0.681818 0.314921 +vt 0.613636 0.275556 +vt 0.590909 0.236191 +vt 0.568181 0.275556 +vt 0.545454 0.236191 +vt 0.522727 0.275556 +vt 0.499999 0.236191 +vt 0.477272 0.275556 +vt 0.431818 0.275556 +vt 0.409090 0.236191 +vt 0.386363 0.275556 +vt 0.363636 0.236191 +vt 0.340909 0.275556 +vt 0.318181 0.236191 +vt 0.295454 0.275556 +vt 0.250000 0.275556 +vt 0.227272 0.236191 +vt 0.204545 0.275556 +vt 0.181818 0.236191 +vt 0.159091 0.275556 +vt 0.136363 0.236191 +vt 0.113636 0.275556 +vt 0.977272 0.275556 +vt 0.954545 0.236191 +vt 0.931818 0.275556 +vt 0.909090 0.236191 +vt 0.886363 0.275556 +vt 0.863635 0.236191 +vt 0.840908 0.275556 +vt 0.795454 0.275556 +vt 0.772726 0.236191 +vt 0.749999 0.275556 +vt 0.727272 0.236191 +vt 0.704545 0.275556 +vt 0.681817 0.236191 +vt 0.659090 0.275556 +vt 0.454545 0.236191 +vt 0.477272 0.196826 +vt 0.431818 0.196826 +vt 0.454545 0.157461 +vt 0.409090 0.157461 +vt 0.272727 0.236191 +vt 0.295454 0.196826 +vt 0.250000 0.196826 +vt 0.272727 0.157461 +vt 0.227272 0.157461 +vt 0.068182 0.275556 +vt 0.090909 0.236191 +vt 0.113636 0.196826 +vt 0.045454 0.236191 +vt 0.068182 0.196826 +vt 0.022727 0.196826 +vt 0.090909 0.157461 +vt 0.045454 0.157461 +vt 0.000000 0.157461 +vt 0.818181 0.236191 +vt 0.840908 0.196826 +vt 0.795454 0.196826 +vt 0.818181 0.157461 +vt 0.772726 0.157461 +vt 0.636363 0.236191 +vt 0.659090 0.196826 +vt 0.613636 0.196826 +vt 0.636363 0.157461 +vt 0.590909 0.157461 +vt 0.522727 0.118096 +vt 0.499999 0.078731 +vt 0.477272 0.118096 +vt 0.454545 0.078731 +vt 0.431818 0.118096 +vt 0.409090 0.078731 +vt 0.386363 0.118096 +vt 0.340909 0.118096 +vt 0.318181 0.078731 +vt 0.295454 0.118096 +vt 0.272727 0.078731 +vt 0.250000 0.118096 +vt 0.227272 0.078731 +vt 0.204545 0.118096 +vt 0.159091 0.118096 +vt 0.136363 0.078731 +vt 0.113636 0.118096 +vt 0.090909 0.078731 +vt 0.068182 0.118096 +vt 0.045454 0.078731 +vt 0.022727 0.118096 +vt 0.568181 0.118096 +vt 0.613636 0.118096 +vt 0.659090 0.118096 +vt 0.590909 0.078731 +vt 0.636363 0.078730 +vt 0.613636 0.039365 +vt 0.681817 0.078731 +vt 0.659090 0.039365 +vt 0.636363 0.000000 +vt 0.886363 0.118096 +vt 0.863635 0.078731 +vt 0.840908 0.118096 +vt 0.818181 0.078731 +vt 0.795454 0.118096 +vt 0.772726 0.078731 +vt 0.749999 0.118096 +vn 0.0000 -1.0000 0.0000 +vn 0.2109 -0.9654 0.1533 +vn -0.0806 -0.9654 0.2480 +vn 0.7236 -0.4472 0.5257 +vn 0.6042 -0.6650 0.4390 +vn 0.8152 -0.5038 0.2857 +vn -0.2608 -0.9654 0.0000 +vn -0.0806 -0.9654 -0.2480 +vn 0.2109 -0.9654 -0.1533 +vn 0.8650 -0.2430 0.4390 +vn -0.2764 -0.4472 0.8506 +vn -0.0198 -0.5038 0.8636 +vn -0.1502 -0.2430 0.9583 +vn -0.8944 -0.4472 0.0000 +vn -0.8274 -0.5038 0.2480 +vn -0.9578 -0.2430 0.1533 +vn -0.2764 -0.4472 -0.8506 +vn -0.4915 -0.5038 -0.7103 +vn -0.4417 -0.2430 -0.8636 +vn 0.7236 -0.4472 -0.5257 +vn 0.5236 -0.5038 -0.6870 +vn 0.6848 -0.2430 -0.6870 +vn 0.6848 -0.2430 0.6870 +vn -0.4417 -0.2430 0.8636 +vn -0.9578 -0.2430 -0.1533 +vn -0.1502 -0.2430 -0.9583 +vn 0.8650 -0.2430 -0.4390 +vn 0.2764 0.4472 0.8506 +vn 0.4915 0.5038 0.7103 +vn 0.2308 0.6650 0.7103 +vn -0.7236 0.4472 0.5257 +vn -0.5236 0.5038 0.6870 +vn -0.6042 0.6650 0.4390 +vn -0.7236 0.4472 -0.5257 +vn -0.8152 0.5038 -0.2857 +vn -0.6042 0.6650 -0.4390 +vn 0.2764 0.4472 -0.8506 +vn 0.0198 0.5038 -0.8636 +vn 0.2308 0.6650 -0.7103 +vn 0.8944 0.4472 0.0000 +vn 0.8274 0.5038 -0.2480 +vn 0.7468 0.6650 0.0000 +vn 0.2608 0.9654 0.0000 +vn 0.0806 0.9654 -0.2480 +vn 0.0000 1.0000 0.0000 +vn 0.5257 0.8506 0.0000 +vn 0.3682 0.8904 -0.2675 +vn 0.6317 0.7275 -0.2675 +vn 0.1625 0.8506 -0.5000 +vn 0.4496 0.7275 -0.5181 +vn 0.6882 0.5257 -0.5000 +vn 0.4915 0.5038 -0.7103 +vn -0.2109 0.9654 -0.1533 +vn -0.1406 0.8904 -0.4328 +vn -0.0592 0.7275 -0.6835 +vn -0.4253 0.8506 -0.3090 +vn -0.3538 0.7275 -0.5877 +vn -0.2629 0.5257 -0.8090 +vn -0.5236 0.5038 -0.6870 +vn -0.2109 0.9654 0.1533 +vn -0.4551 0.8904 0.0000 +vn -0.6683 0.7275 -0.1549 +vn -0.4253 0.8506 0.3090 +vn -0.6683 0.7275 0.1549 +vn -0.8506 0.5257 0.0000 +vn -0.8152 0.5038 0.2857 +vn 0.0806 0.9654 0.2480 +vn -0.1406 0.8904 0.4328 +vn -0.3538 0.7275 0.5877 +vn 0.1625 0.8506 0.5000 +vn -0.0592 0.7275 0.6835 +vn -0.2629 0.5257 0.8090 +vn 0.0198 0.5038 0.8636 +vn 0.3682 0.8904 0.2675 +vn 0.4496 0.7275 0.5181 +vn 0.6317 0.7275 0.2675 +vn 0.6882 0.5257 0.5000 +vn 0.8274 0.5038 0.2480 +vn 0.9578 0.2430 -0.1533 +vn 0.9510 0.0000 -0.3090 +vn 0.8593 0.2724 -0.4328 +vn 0.8090 0.0089 -0.5878 +vn 0.6772 0.2724 -0.6835 +vn 0.5878 0.0000 -0.8090 +vn 0.4417 0.2430 -0.8636 +vn 0.1502 0.2430 -0.9583 +vn 0.0000 0.0000 -1.0000 +vn -0.1461 0.2724 -0.9510 +vn -0.3090 0.0089 -0.9510 +vn -0.4407 0.2724 -0.8553 +vn -0.5878 0.0000 -0.8090 +vn -0.6848 0.2430 -0.6870 +vn -0.8650 0.2430 -0.4390 +vn -0.9510 0.0000 -0.3090 +vn -0.9496 0.2724 -0.1549 +vn -0.9999 0.0089 0.0000 +vn -0.9496 0.2724 0.1549 +vn -0.9510 0.0000 0.3090 +vn -0.8650 0.2430 0.4390 +vn -0.6848 0.2430 0.6870 +vn -0.5878 0.0000 0.8090 +vn -0.4407 0.2724 0.8553 +vn -0.3090 0.0089 0.9510 +vn -0.1461 0.2724 0.9510 +vn 0.0000 0.0000 1.0000 +vn 0.1502 0.2430 0.9583 +vn 0.4417 0.2430 0.8636 +vn 0.5878 0.0000 0.8090 +vn 0.6772 0.2724 0.6835 +vn 0.8090 0.0089 0.5878 +vn 0.8593 0.2724 0.4328 +vn 0.9510 0.0000 0.3090 +vn 0.9578 0.2430 0.1533 +vn 0.3090 -0.0089 -0.9510 +vn 0.4407 -0.2724 -0.8553 +vn 0.1461 -0.2724 -0.9510 +vn 0.2629 -0.5257 -0.8090 +vn -0.0198 -0.5038 -0.8636 +vn -0.8090 -0.0089 -0.5878 +vn -0.6772 -0.2724 -0.6835 +vn -0.8593 -0.2724 -0.4328 +vn -0.6882 -0.5257 -0.5000 +vn -0.8274 -0.5038 -0.2480 +vn -0.8090 -0.0089 0.5878 +vn -0.8593 -0.2724 0.4328 +vn -0.6772 -0.2724 0.6835 +vn -0.6882 -0.5257 0.5000 +vn -0.4915 -0.5038 0.7103 +vn 0.3090 -0.0089 0.9510 +vn 0.1461 -0.2724 0.9510 +vn 0.4407 -0.2724 0.8553 +vn 0.2629 -0.5257 0.8090 +vn 0.5236 -0.5038 0.6870 +vn 0.9999 -0.0089 0.0000 +vn 0.9496 -0.2724 0.1549 +vn 0.9496 -0.2724 -0.1549 +vn 0.8506 -0.5257 0.0000 +vn 0.8152 -0.5038 -0.2857 +vn 0.6042 -0.6650 -0.4390 +vn 0.4253 -0.8506 -0.3090 +vn 0.3538 -0.7275 -0.5878 +vn 0.1406 -0.8904 -0.4328 +vn 0.0592 -0.7275 -0.6835 +vn -0.1625 -0.8506 -0.5000 +vn -0.2308 -0.6650 -0.7103 +vn -0.4496 -0.7275 -0.5181 +vn -0.3682 -0.8904 -0.2675 +vn -0.6317 -0.7275 -0.2675 +vn -0.5257 -0.8506 0.0000 +vn -0.7468 -0.6650 0.0000 +vn -0.6317 -0.7275 0.2675 +vn -0.3682 -0.8904 0.2675 +vn -0.4496 -0.7275 0.5181 +vn -0.1625 -0.8506 0.5000 +vn -0.2308 -0.6650 0.7103 +vn 0.6683 -0.7275 -0.1549 +vn 0.6683 -0.7275 0.1549 +vn 0.4551 -0.8904 0.0000 +vn 0.4253 -0.8506 0.3090 +vn 0.0592 -0.7275 0.6835 +vn 0.1406 -0.8904 0.4328 +vn 0.3538 -0.7275 0.5878 +usemtl Material.002 +s 1 +f 1/1/1 16/2/2 15/3/3 +f 2/4/4 18/5/5 24/6/6 +f 1/7/1 15/8/3 30/9/7 +f 1/10/1 30/11/7 36/12/8 +f 1/13/1 36/14/8 25/15/9 +f 2/4/4 24/6/6 45/16/10 +f 3/17/11 21/18/12 51/19/13 +f 4/20/14 33/21/15 57/22/16 +f 5/23/17 39/24/18 63/25/19 +f 6/26/20 42/27/21 69/28/22 +f 2/4/4 45/16/10 52/29/23 +f 3/17/11 51/19/13 58/30/24 +f 4/20/14 57/22/16 64/31/25 +f 5/23/17 63/25/19 70/32/26 +f 6/26/20 69/28/22 46/33/27 +f 7/34/28 75/35/29 90/36/30 +f 8/37/31 78/38/32 96/39/33 +f 9/40/34 81/41/35 99/42/36 +f 10/43/37 84/44/38 102/45/39 +f 11/46/40 87/47/41 91/48/42 +f 93/49/43 100/50/44 12/51/45 +f 92/52/46 103/53/47 93/49/43 +f 91/48/42 104/54/48 92/52/46 +f 93/49/43 103/53/47 100/50/44 +f 103/53/47 101/55/49 100/50/44 +f 92/52/46 104/54/48 103/53/47 +f 104/54/48 105/56/50 103/53/47 +f 103/53/47 105/56/50 101/55/49 +f 105/56/50 102/57/39 101/55/49 +f 91/48/42 87/47/41 104/54/48 +f 87/47/41 86/58/51 104/54/48 +f 104/54/48 86/58/51 105/56/50 +f 86/58/51 85/59/52 105/56/50 +f 105/56/50 85/59/52 102/57/39 +f 85/59/52 10/43/37 102/57/39 +f 100/60/44 97/61/53 12/62/45 +f 101/63/49 106/64/54 100/60/44 +f 102/45/39 107/65/55 101/63/49 +f 100/60/44 106/64/54 97/61/53 +f 106/64/54 98/66/56 97/61/53 +f 101/63/49 107/65/55 106/64/54 +f 107/65/55 108/67/57 106/64/54 +f 106/64/54 108/67/57 98/66/56 +f 108/67/57 99/68/36 98/66/56 +f 102/45/39 84/44/38 107/65/55 +f 84/44/38 83/69/58 107/65/55 +f 107/65/55 83/69/58 108/67/57 +f 83/69/58 82/70/59 108/67/57 +f 108/67/57 82/70/59 99/68/36 +f 82/70/59 9/40/34 99/68/36 +f 97/71/53 94/72/60 12/73/45 +f 98/74/56 109/75/61 97/71/53 +f 99/42/36 110/76/62 98/74/56 +f 97/71/53 109/75/61 94/72/60 +f 109/75/61 95/77/63 94/72/60 +f 98/74/56 110/76/62 109/75/61 +f 110/76/62 111/78/64 109/75/61 +f 109/75/61 111/78/64 95/77/63 +f 111/78/64 96/79/33 95/77/63 +f 99/42/36 81/41/35 110/76/62 +f 81/41/35 80/80/65 110/76/62 +f 110/76/62 80/80/65 111/78/64 +f 80/80/65 79/81/66 111/78/64 +f 111/78/64 79/81/66 96/79/33 +f 79/81/66 8/82/31 96/79/33 +f 94/83/60 88/84/67 12/85/45 +f 95/86/63 112/87/68 94/83/60 +f 96/39/33 113/88/69 95/86/63 +f 94/83/60 112/87/68 88/84/67 +f 112/87/68 89/89/70 88/84/67 +f 95/86/63 113/88/69 112/87/68 +f 113/88/69 114/90/71 112/87/68 +f 112/87/68 114/90/71 89/89/70 +f 114/90/71 90/91/30 89/89/70 +f 96/39/33 78/38/32 113/88/69 +f 78/38/32 77/92/72 113/88/69 +f 113/88/69 77/92/72 114/90/71 +f 77/92/72 76/93/73 114/90/71 +f 114/90/71 76/93/73 90/91/30 +f 76/93/73 7/34/28 90/91/30 +f 88/94/67 93/95/43 12/96/45 +f 89/97/70 115/98/74 88/94/67 +f 90/36/30 116/99/75 89/97/70 +f 88/94/67 115/98/74 93/95/43 +f 115/98/74 92/100/46 93/95/43 +f 89/97/70 116/99/75 115/98/74 +f 116/99/75 117/101/76 115/98/74 +f 115/98/74 117/101/76 92/100/46 +f 117/101/76 91/102/42 92/100/46 +f 90/36/30 75/35/29 116/99/75 +f 75/35/29 74/103/77 116/99/75 +f 116/99/75 74/103/77 117/101/76 +f 74/103/77 73/104/78 117/101/76 +f 117/101/76 73/104/78 91/102/42 +f 73/104/78 11/46/40 91/102/42 +f 48/105/79 87/47/41 11/46/40 +f 47/106/80 118/107/81 48/105/79 +f 46/33/27 119/108/82 47/106/80 +f 48/105/79 118/107/81 87/47/41 +f 118/107/81 86/58/51 87/47/41 +f 47/106/80 119/108/82 118/107/81 +f 119/108/82 120/109/83 118/107/81 +f 118/107/81 120/109/83 86/58/51 +f 120/109/83 85/59/52 86/58/51 +f 46/33/27 69/28/22 119/108/82 +f 69/28/22 68/110/84 119/108/82 +f 119/108/82 68/110/84 120/109/83 +f 68/110/84 67/111/85 120/109/83 +f 120/109/83 67/111/85 85/59/52 +f 67/111/85 10/43/37 85/59/52 +f 72/112/86 84/44/38 10/43/37 +f 71/113/87 121/114/88 72/112/86 +f 70/32/26 122/115/89 71/113/87 +f 72/112/86 121/114/88 84/44/38 +f 121/114/88 83/69/58 84/44/38 +f 71/113/87 122/115/89 121/114/88 +f 122/115/89 123/116/90 121/114/88 +f 121/114/88 123/116/90 83/69/58 +f 123/116/90 82/70/59 83/69/58 +f 70/32/26 63/25/19 122/115/89 +f 63/25/19 62/117/91 122/115/89 +f 122/115/89 62/117/91 123/116/90 +f 62/117/91 61/118/92 123/116/90 +f 123/116/90 61/118/92 82/70/59 +f 61/118/92 9/40/34 82/70/59 +f 66/119/93 81/41/35 9/40/34 +f 65/120/94 124/121/95 66/119/93 +f 64/31/25 125/122/96 65/120/94 +f 66/119/93 124/121/95 81/41/35 +f 124/121/95 80/80/65 81/41/35 +f 65/120/94 125/122/96 124/121/95 +f 125/122/96 126/123/97 124/121/95 +f 124/121/95 126/123/97 80/80/65 +f 126/123/97 79/81/66 80/80/65 +f 64/31/25 57/22/16 125/122/96 +f 57/22/16 56/124/98 125/122/96 +f 125/122/96 56/124/98 126/123/97 +f 56/124/98 55/125/99 126/123/97 +f 126/123/97 55/125/99 79/81/66 +f 55/125/99 8/82/31 79/81/66 +f 60/126/100 78/38/32 8/37/31 +f 59/127/101 127/128/102 60/126/100 +f 58/30/24 128/129/103 59/127/101 +f 60/126/100 127/128/102 78/38/32 +f 127/128/102 77/92/72 78/38/32 +f 59/127/101 128/129/103 127/128/102 +f 128/129/103 129/130/104 127/128/102 +f 127/128/102 129/130/104 77/92/72 +f 129/130/104 76/93/73 77/92/72 +f 58/30/24 51/19/13 128/129/103 +f 51/19/13 50/131/105 128/129/103 +f 128/129/103 50/131/105 129/130/104 +f 50/131/105 49/132/106 129/130/104 +f 129/130/104 49/132/106 76/93/73 +f 49/132/106 7/34/28 76/93/73 +f 54/133/107 75/35/29 7/34/28 +f 53/134/108 130/135/109 54/133/107 +f 52/29/23 131/136/110 53/134/108 +f 54/133/107 130/135/109 75/35/29 +f 130/135/109 74/103/77 75/35/29 +f 53/134/108 131/136/110 130/135/109 +f 131/136/110 132/137/111 130/135/109 +f 130/135/109 132/137/111 74/103/77 +f 132/137/111 73/104/78 74/103/77 +f 52/29/23 45/16/10 131/136/110 +f 45/16/10 44/138/112 131/136/110 +f 131/136/110 44/138/112 132/137/111 +f 44/138/112 43/139/113 132/137/111 +f 132/137/111 43/139/113 73/104/78 +f 43/139/113 11/46/40 73/104/78 +f 67/111/85 72/112/86 10/43/37 +f 68/110/84 133/140/114 67/111/85 +f 69/28/22 134/141/115 68/110/84 +f 67/111/85 133/140/114 72/112/86 +f 133/140/114 71/113/87 72/112/86 +f 68/110/84 134/141/115 133/140/114 +f 134/141/115 135/142/116 133/140/114 +f 133/140/114 135/142/116 71/113/87 +f 135/142/116 70/32/26 71/113/87 +f 69/28/22 42/27/21 134/141/115 +f 42/27/21 41/143/117 134/141/115 +f 134/141/115 41/143/117 135/142/116 +f 41/143/117 40/144/118 135/142/116 +f 135/142/116 40/144/118 70/32/26 +f 40/144/118 5/23/17 70/32/26 +f 61/118/92 66/119/93 9/40/34 +f 62/117/91 136/145/119 61/118/92 +f 63/25/19 137/146/120 62/117/91 +f 61/118/92 136/145/119 66/119/93 +f 136/145/119 65/120/94 66/119/93 +f 62/117/91 137/146/120 136/145/119 +f 137/146/120 138/147/121 136/145/119 +f 136/145/119 138/147/121 65/120/94 +f 138/147/121 64/31/25 65/120/94 +f 63/25/19 39/24/18 137/146/120 +f 39/24/18 38/148/122 137/146/120 +f 137/146/120 38/148/122 138/147/121 +f 38/148/122 37/149/123 138/147/121 +f 138/147/121 37/149/123 64/31/25 +f 37/149/123 4/20/14 64/31/25 +f 55/125/99 60/150/100 8/82/31 +f 56/124/98 139/151/124 55/125/99 +f 57/22/16 140/152/125 56/124/98 +f 55/125/99 139/151/124 60/150/100 +f 139/151/124 59/153/101 60/150/100 +f 56/124/98 140/152/125 139/151/124 +f 140/152/125 141/154/126 139/151/124 +f 139/151/124 141/154/126 59/153/101 +f 141/154/126 58/155/24 59/153/101 +f 57/22/16 33/21/15 140/152/125 +f 33/21/15 32/156/127 140/152/125 +f 140/152/125 32/156/127 141/154/126 +f 32/156/127 31/157/128 141/154/126 +f 141/154/126 31/157/128 58/155/24 +f 31/157/128 3/158/11 58/155/24 +f 49/132/106 54/133/107 7/34/28 +f 50/131/105 142/159/129 49/132/106 +f 51/19/13 143/160/130 50/131/105 +f 49/132/106 142/159/129 54/133/107 +f 142/159/129 53/134/108 54/133/107 +f 50/131/105 143/160/130 142/159/129 +f 143/160/130 144/161/131 142/159/129 +f 142/159/129 144/161/131 53/134/108 +f 144/161/131 52/29/23 53/134/108 +f 51/19/13 21/18/12 143/160/130 +f 21/18/12 20/162/132 143/160/130 +f 143/160/130 20/162/132 144/161/131 +f 20/162/132 19/163/133 144/161/131 +f 144/161/131 19/163/133 52/29/23 +f 19/163/133 2/4/4 52/29/23 +f 43/139/113 48/105/79 11/46/40 +f 44/138/112 145/164/134 43/139/113 +f 45/16/10 146/165/135 44/138/112 +f 43/139/113 145/164/134 48/105/79 +f 145/164/134 47/106/80 48/105/79 +f 44/138/112 146/165/135 145/164/134 +f 146/165/135 147/166/136 145/164/134 +f 145/164/134 147/166/136 47/106/80 +f 147/166/136 46/33/27 47/106/80 +f 45/16/10 24/6/6 146/165/135 +f 24/6/6 23/167/137 146/165/135 +f 146/165/135 23/167/137 147/166/136 +f 23/167/137 22/168/138 147/166/136 +f 147/166/136 22/168/138 46/33/27 +f 22/168/138 6/26/20 46/33/27 +f 27/169/139 42/27/21 6/26/20 +f 26/170/140 148/171/141 27/169/139 +f 25/15/9 149/172/142 26/170/140 +f 27/169/139 148/171/141 42/27/21 +f 148/171/141 41/143/117 42/27/21 +f 26/170/140 149/172/142 148/171/141 +f 149/172/142 150/173/143 148/171/141 +f 148/171/141 150/173/143 41/143/117 +f 150/173/143 40/144/118 41/143/117 +f 25/15/9 36/14/8 149/172/142 +f 36/14/8 35/174/144 149/172/142 +f 149/172/142 35/174/144 150/173/143 +f 35/174/144 34/175/145 150/173/143 +f 150/173/143 34/175/145 40/144/118 +f 34/175/145 5/23/17 40/144/118 +f 34/176/145 39/24/18 5/23/17 +f 35/177/144 151/178/146 34/176/145 +f 36/12/8 152/179/147 35/177/144 +f 34/176/145 151/178/146 39/24/18 +f 151/178/146 38/148/122 39/24/18 +f 35/177/144 152/179/147 151/178/146 +f 152/179/147 153/180/148 151/178/146 +f 151/178/146 153/180/148 38/148/122 +f 153/180/148 37/149/123 38/148/122 +f 36/12/8 30/11/7 152/179/147 +f 30/11/7 29/181/149 152/179/147 +f 152/179/147 29/181/149 153/180/148 +f 29/181/149 28/182/150 153/180/148 +f 153/180/148 28/182/150 37/149/123 +f 28/182/150 4/20/14 37/149/123 +f 28/183/150 33/21/15 4/20/14 +f 29/184/149 154/185/151 28/183/150 +f 30/9/7 155/186/152 29/184/149 +f 28/183/150 154/185/151 33/21/15 +f 154/185/151 32/156/127 33/21/15 +f 29/184/149 155/186/152 154/185/151 +f 155/186/152 156/187/153 154/185/151 +f 154/185/151 156/187/153 32/156/127 +f 156/187/153 31/157/128 32/156/127 +f 30/9/7 15/8/3 155/186/152 +f 15/8/3 14/188/154 155/186/152 +f 155/186/152 14/188/154 156/187/153 +f 14/188/154 13/189/155 156/187/153 +f 156/187/153 13/189/155 31/157/128 +f 13/189/155 3/158/11 31/157/128 +f 22/168/138 27/190/139 6/26/20 +f 23/167/137 157/191/156 22/168/138 +f 24/6/6 158/192/157 23/167/137 +f 22/168/138 157/191/156 27/190/139 +f 157/191/156 26/193/140 27/190/139 +f 23/167/137 158/192/157 157/191/156 +f 158/192/157 159/194/158 157/191/156 +f 157/191/156 159/194/158 26/193/140 +f 159/194/158 25/195/9 26/193/140 +f 24/6/6 18/5/5 158/192/157 +f 18/5/5 17/196/159 158/192/157 +f 158/192/157 17/196/159 159/194/158 +f 17/196/159 16/197/2 159/194/158 +f 159/194/158 16/197/2 25/195/9 +f 16/197/2 1/198/1 25/195/9 +f 13/199/155 21/18/12 3/17/11 +f 14/200/154 160/201/160 13/199/155 +f 15/3/3 161/202/161 14/200/154 +f 13/199/155 160/201/160 21/18/12 +f 160/201/160 20/162/132 21/18/12 +f 14/200/154 161/202/161 160/201/160 +f 161/202/161 162/203/162 160/201/160 +f 160/201/160 162/203/162 20/162/132 +f 162/203/162 19/163/133 20/162/132 +f 15/3/3 16/2/2 161/202/161 +f 16/2/2 17/204/159 161/202/161 +f 161/202/161 17/204/159 162/203/162 +f 17/204/159 18/205/5 162/203/162 +f 162/203/162 18/205/5 19/163/133 +f 18/205/5 2/4/4 19/163/133 diff --git a/sphere.png b/sphere.png Binary files differnew file mode 100644 index 0000000..ea6b0cd --- /dev/null +++ b/sphere.png diff --git a/src/light.c b/src/light.c new file mode 100644 index 0000000..08da8e6 --- /dev/null +++ b/src/light.c @@ -0,0 +1,20 @@ +#include "../include/light.h" + +void honey_point_light_new(honey_point_light* light, + float x, float y, float z, + float r, float g, float b, + float constant, + float linear, + float quadratic) { + light->position[0] = x; + light->position[1] = y; + light->position[2] = z; + + light->color[0] = r; + light->color[1] = g; + light->color[2] = b; + + light->constant = constant; + light->linear = linear; + light->quadratic = quadratic; +} diff --git a/src/shader.c b/src/shader.c index d250629..d570f52 100644 --- a/src/shader.c +++ b/src/shader.c @@ -164,4 +164,61 @@ void honey_shader_set_mat4(honey_shader shader, } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +void honey_shader_set_point_light(honey_shader shader, + int point_light_index, + honey_point_light light) { + char name[HONEY_MAX_LIGHT_NAME_LENGTH]; + + snprintf(name, + HONEY_MAX_LIGHT_NAME_LENGTH, + "point_lights[%d].position", + point_light_index); + honey_shader_set_vec3(shader, name, light.position); + + snprintf(name, + HONEY_MAX_LIGHT_NAME_LENGTH, + "point_lights[%d].color", + point_light_index); + honey_shader_set_vec3(shader, name, light.color); + + snprintf(name, + HONEY_MAX_LIGHT_NAME_LENGTH, + "point_lights[%d].constant", + point_light_index); + honey_shader_set_float(shader, name, light.constant); + + snprintf(name, + HONEY_MAX_LIGHT_NAME_LENGTH, + "point_lights[%d].linear", + point_light_index); + honey_shader_set_float(shader, name, light.linear); + + snprintf(name, + HONEY_MAX_LIGHT_NAME_LENGTH, + "point_lights[%d].quadratic", + point_light_index); + honey_shader_set_float(shader, name, light.quadratic); +} + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +void honey_shader_set_directional_light(honey_shader shader, + int directional_light_index, + honey_directional_light light) { + char name[HONEY_MAX_LIGHT_NAME_LENGTH]; + + snprintf(name, + HONEY_MAX_LIGHT_NAME_LENGTH, + "directional_lights[%d].direction", + directional_light_index); + honey_shader_set_vec3(shader, name, light.direction); + + snprintf(name, + HONEY_MAX_LIGHT_NAME_LENGTH, + "directional_lights[%d].color", + directional_light_index); + honey_shader_set_vec3(shader, name, light.color); +} + |