diff --git a/example/example.mk b/example/example.mk index 0ae62d8..c025147 100644 --- a/example/example.mk +++ b/example/example.mk @@ -1129,3 +1129,21 @@ BLOOM_LIGHTMAP_OBJ = \ example/bloom_lightmap.elf: LDSCRIPT = $(LIB)/main.lds example/bloom_lightmap.elf: $(START_OBJ) $(BLOOM_LIGHTMAP_OBJ) + +MODIFIER_VOLUME_HOLE_OBJ = \ + example/modifier_volume_hole.o \ + holly/core.o \ + holly/region_array.o \ + holly/background.o \ + holly/ta_fifo_polygon_converter.o \ + holly/video_output.o \ + sh7091/serial.o \ + maple/maple.o \ + sh7091/c_serial.o \ + printf/printf.o \ + printf/unparse.o \ + printf/parse.o \ + $(LIBGCC) + +example/modifier_volume_hole.elf: LDSCRIPT = $(LIB)/main.lds +example/modifier_volume_hole.elf: $(START_OBJ) $(MODIFIER_VOLUME_HOLE_OBJ) diff --git a/example/modifier_volume_hole.cpp b/example/modifier_volume_hole.cpp new file mode 100644 index 0000000..038e465 --- /dev/null +++ b/example/modifier_volume_hole.cpp @@ -0,0 +1,451 @@ +#include + +#include "holly/background.hpp" +#include "holly/core.hpp" +#include "holly/core_bits.hpp" +#include "holly/holly.hpp" +#include "holly/isp_tsp.hpp" +#include "holly/region_array.hpp" +#include "holly/ta_bits.hpp" +#include "holly/ta_fifo_polygon_converter.hpp" +#include "holly/ta_global_parameter.hpp" +#include "holly/ta_parameter.hpp" +#include "holly/ta_vertex_parameter.hpp" +#include "holly/texture_memory_alloc5.hpp" +#include "holly/video_output.hpp" + +#include "systembus.hpp" +#include "systembus_bits.hpp" + +#include "maple/maple.hpp" +#include "maple/maple_host_command_writer.hpp" +#include "maple/maple_bus_bits.hpp" +#include "maple/maple_bus_commands.hpp" +#include "maple/maple_bus_ft0.hpp" + +#include "memorymap.hpp" + +#include "sh7091/sh7091.hpp" +#include "sh7091/sh7091_bits.hpp" +#include "sh7091/serial.hpp" +#include "printf/printf.h" + +#include "math/vec2.hpp" +#include "math/vec3.hpp" +#include "math/vec4.hpp" +#include "math/mat2x2.hpp" +#include "math/mat3x3.hpp" +#include "math/mat4x4.hpp" +#include "math/geometry.hpp" +#include "math/transform.hpp" + +using vec2 = vec<2, float>; +using vec3 = vec<3, float>; +using vec4 = vec<4, float>; +using mat4x4 = mat<4, 4, float>; + +#include "interrupt.hpp" +#include "assert.h" + +#include "model/blender_export.h" +#include "model/modifier_volume_test/closed_volume.h" + +void vbr100() +{ + serial::string("vbr100\n"); + interrupt_exception(); +} + +void vbr400() +{ + serial::string("vbr400\n"); + interrupt_exception(); +} + +const int framebuffer_width = 640; +const int framebuffer_height = 480; +const int tile_width = framebuffer_width / 32; +const int tile_height = framebuffer_height / 32; + +constexpr uint32_t ta_alloc = 0 + | ta_alloc_ctrl::pt_opb::no_list + | ta_alloc_ctrl::tm_opb::no_list + | ta_alloc_ctrl::t_opb::no_list + | ta_alloc_ctrl::om_opb::no_list + | ta_alloc_ctrl::o_opb::_32x4byte; + +constexpr int ta_cont_count = 1; +constexpr struct opb_size opb_size[ta_cont_count] = { + { + .opaque = 32 * 4, + .opaque_modifier = 0, + .translucent = 0, + .translucent_modifier = 0, + .punch_through = 0 + } +}; + +static volatile int ta_in_use = 0; +static volatile int core_in_use = 0; +static volatile int next_frame = 0; +static volatile int framebuffer_ix = 0; +static volatile int next_frame_ix = 0; + +static inline void pump_events(uint32_t istnrm) +{ + if (istnrm & istnrm::v_blank_in) { + system.ISTNRM = istnrm::v_blank_in; + next_frame = 1; + holly.FB_R_SOF1 = texture_memory_alloc.framebuffer[next_frame_ix].start; + } + + if (istnrm & istnrm::end_of_render_tsp) { + system.ISTNRM = istnrm::end_of_render_tsp + | istnrm::end_of_render_isp + | istnrm::end_of_render_video; + + next_frame_ix = framebuffer_ix; + framebuffer_ix += 1; + if (framebuffer_ix >= 3) framebuffer_ix = 0; + + core_in_use = 0; + } + + if (istnrm & istnrm::end_of_transferring_opaque_list) { + system.ISTNRM = istnrm::end_of_transferring_opaque_list; + + core_in_use = 1; + core_start_render2(texture_memory_alloc.region_array.start, + texture_memory_alloc.isp_tsp_parameters.start, + texture_memory_alloc.background[0].start, + texture_memory_alloc.framebuffer[framebuffer_ix].start, + framebuffer_width); + + ta_in_use = 0; + } +} + +void vbr600() +{ + uint32_t sr; + asm volatile ("stc sr,%0" : "=r" (sr)); + sr |= sh::sr::imask(15); + asm volatile ("ldc %0,sr" : : "r" (sr)); + //serial::string("imask\n"); + + //check_pipeline(); + + if (sh7091.CCN.EXPEVT == 0 && sh7091.CCN.INTEVT == 0x320) { + uint32_t istnrm = system.ISTNRM; + uint32_t isterr = system.ISTERR; + + if (isterr) { + serial::string("isterr: "); + serial::integer(system.ISTERR); + } + + pump_events(istnrm); + + sr &= ~sh::sr::imask(15); + asm volatile ("ldc %0,sr" : : "r" (sr)); + + return; + } + + serial::string("vbr600\n"); + interrupt_exception(); +} + +static ft0::data_transfer::data_format data[4]; + +uint8_t send_buf[1024] __attribute__((aligned(32))); +uint8_t recv_buf[1024] __attribute__((aligned(32))); + +void do_get_condition() +{ + auto writer = maple::host_command_writer(send_buf, recv_buf); + + using command_type = maple::get_condition; + using response_type = maple::data_transfer; + + auto [host_command, host_response] + = writer.append_command_all_ports(); + + for (int port = 0; port < 4; port++) { + auto& data_fields = host_command[port].bus_data.data_fields; + data_fields.function_type = std::byteswap(function_type::controller); + } + maple::dma_start(send_buf, writer.send_offset, + recv_buf, writer.recv_offset); + + for (uint8_t port = 0; port < 4; port++) { + auto& bus_data = host_response[port].bus_data; + if (bus_data.command_code != response_type::command_code) { + return; + } + auto& data_fields = bus_data.data_fields; + if ((std::byteswap(data_fields.function_type) & function_type::controller) == 0) { + return; + } + + data[port].digital_button = data_fields.data.digital_button; + for (int i = 0; i < 6; i++) { + data[port].analog_coordinate_axis[i] + = data_fields.data.analog_coordinate_axis[i]; + } + } +} + +static inline void global_polygon(ta_parameter_writer& writer, + uint32_t list) +{ + uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume + | list + | obj_control::col_type::intensity_mode_1 + | obj_control::gouraud + //| obj_control::shadow + ; + + uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater + | isp_tsp_instruction_word::culling_mode::no_culling; + + uint32_t tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one + | tsp_instruction_word::dst_alpha_instr::zero + | tsp_instruction_word::texture_shading_instruction::decal + | tsp_instruction_word::fog_control::no_fog + ; + + uint32_t texture_control_word = 0; + + float a = 1.0f; + float r = 1.0f; + float g = 1.0f; + float b = 1.0f; + + writer.append() = + ta_global_parameter::polygon_type_1(parameter_control_word, + isp_tsp_instruction_word, + tsp_instruction_word, + texture_control_word, + a, + r, + g, + b + ); +} + +static inline void render_quad(ta_parameter_writer& writer, + vec3 ap, + vec3 bp, + vec3 cp, + vec3 dp, + float ai, + float bi, + float ci, + float di) +{ + writer.append() = + ta_vertex_parameter::polygon_type_2(polygon_vertex_parameter_control_word(false), + ap.x, ap.y, ap.z, + ai); + + writer.append() = + ta_vertex_parameter::polygon_type_2(polygon_vertex_parameter_control_word(false), + bp.x, bp.y, bp.z, + bi); + + writer.append() = + ta_vertex_parameter::polygon_type_2(polygon_vertex_parameter_control_word(false), + dp.x, dp.y, dp.z, + di); + + writer.append() = + ta_vertex_parameter::polygon_type_2(polygon_vertex_parameter_control_word(true), + cp.x, cp.y, cp.z, + ci); +} + +static inline vec3 screen_transform(vec3 v) +{ + float dim = 480 / 2.0; + + return { + v.x / (1.f * v.z) * dim + 640 / 2.0f, + v.y / (1.f * v.z) * dim + 480 / 2.0f, + 1 / v.z, + }; +} + +static inline void render_polygon(ta_parameter_writer& writer, + const polygon * polygon, + const vec3 * position) +{ + vec3 ap = position[polygon->a]; + vec3 bp = position[polygon->b]; + vec3 cp = position[polygon->c]; + vec3 dp = position[polygon->d]; + + if (ap.z < 0 || bp.z < 0 || cp.z < 0 || dp.z < 0) { + return; + } + + float ai = 1.0; + float bi = 1.0; + float ci = 1.0; + float di = 1.0; + + render_quad(writer, + screen_transform(ap), + screen_transform(bp), + screen_transform(cp), + screen_transform(dp), + ai, bi, ci, di); +} + +void render_blender_object(ta_parameter_writer& writer, + const mat4x4& screen_trans, + const object * object) +{ + const mat4x4 trans = screen_trans + * translate(object->location) + * scale(object->scale) + * rotate_quaternion(object->rotation); + + const mesh * mesh = object->mesh; + + vec3 position[mesh->position_length]; + for (int i = 0; i < mesh->position_length; i++) { + position[i] = trans * mesh->position[i]; + } + + global_polygon(writer, + para_control::list_type::opaque); + + for (int i = 0; i < mesh->polygons_length; i++) { + const polygon * polygon = &mesh->polygons[i]; + render_polygon(writer, polygon, position); + } +} + +void transfer_scene(ta_parameter_writer& writer, const mat4x4& screen_trans) +{ + // opaque + { + for (uint32_t i = 0; i < (sizeof (objects)) / (sizeof (objects[0])); i++) { + render_blender_object(writer, screen_trans, &objects[i]); + } + + // end of opaque list + writer.append() = + ta_global_parameter::end_of_list(para_control::para_type::end_of_list); + } +} + +static inline mat4x4 update_analog(const mat4x4& screen_trans) +{ + const float l_ = static_cast(data[0].analog_coordinate_axis[0]) * (1.f / 255.f); + const float r_ = static_cast(data[0].analog_coordinate_axis[1]) * (1.f / 255.f); + + const float x_ = static_cast(data[0].analog_coordinate_axis[2] - 0x80) / 127.f; + const float y_ = static_cast(data[0].analog_coordinate_axis[3] - 0x80) / 127.f; + float x = 0.05f * -x_; + float y = 0.05f * y_; + + mat4x4 t = translate((vec3){0, 0, y}); + + float theta = 0; + if (l_ > 0.1f) { + theta = -0.05f * l_; + } else if (r_ > 0.1f) { + theta = 0.05f * r_; + } + + mat4x4 rx = rotate_x(x); + + mat4x4 ry = rotate_y(theta); + + //mat4x4 rz = rotate_z(y); + + return t * screen_trans * ry * rx; +} + +uint8_t __attribute__((aligned(32))) ta_parameter_buf[1024 * 1024]; + +void main() +{ + serial::init(0); + + interrupt_init(); + + holly.SOFTRESET = softreset::pipeline_soft_reset + | softreset::ta_soft_reset; + holly.SOFTRESET = 0; + + core_init(); + + holly.FPU_SHAD_SCALE = fpu_shad_scale::simple_shadow_enable::intensity_volume_mode + | fpu_shad_scale::scale_factor_for_shadows(128); + + system.ISTNRM = 0xffffffff; + system.ISTERR = 0xffffffff; + system.IML6NRM = istnrm::end_of_render_tsp + | istnrm::v_blank_in + | istnrm::end_of_transferring_opaque_list; + + region_array_multipass(tile_width, + tile_height, + opb_size, + ta_cont_count, + texture_memory_alloc.region_array.start, + texture_memory_alloc.object_list.start); + + background_parameter2(texture_memory_alloc.background[0].start, + 0xff202040); + + ta_parameter_writer writer = ta_parameter_writer(ta_parameter_buf, (sizeof (ta_parameter_buf))); + + video_output::set_mode_vga(); + do_get_condition(); + + mat4x4 screen_trans = { + 1, 0, 0, 0, + 0, 0, -1, 1, + 0, 1, 0, 3.6, + 0, 0, 0, 1, + }; + + int frame = 0; + + while (1) { + maple::dma_wait_complete(); + do_get_condition(); + screen_trans = update_analog(screen_trans); + + writer.offset = 0; + transfer_scene(writer, screen_trans); + while (ta_in_use); + while (core_in_use); + ta_in_use = 1; + ta_polygon_converter_init2(texture_memory_alloc.isp_tsp_parameters.start, + texture_memory_alloc.isp_tsp_parameters.end, + texture_memory_alloc.object_list.start, + texture_memory_alloc.object_list.end, + opb_size[0].total(), + ta_alloc, + tile_width, + tile_height); + ta_polygon_converter_writeback(writer.buf, writer.offset); + ta_polygon_converter_transfer(writer.buf, writer.offset); + while (next_frame == 0); + next_frame = 0; + + if ((frame++ % 60) == 0) { + const mat4x4& t = screen_trans; + printf("\n"); + printf("%f %f %f %f\n", t[0][0], t[0][1], t[0][2], t[0][3]); + printf("%f %f %f %f\n", t[1][0], t[1][1], t[1][2], t[1][3]); + printf("%f %f %f %f\n", t[2][0], t[2][1], t[2][2], t[2][3]); + printf("%f %f %f %f\n", t[3][0], t[3][1], t[3][2], t[3][3]); + } + } +} diff --git a/model/modifier_volume_test/closed_volume.blend b/model/modifier_volume_test/closed_volume.blend new file mode 100644 index 0000000..0982faf Binary files /dev/null and b/model/modifier_volume_test/closed_volume.blend differ diff --git a/model/modifier_volume_test/closed_volume.h b/model/modifier_volume_test/closed_volume.h new file mode 100644 index 0000000..8a4d753 --- /dev/null +++ b/model/modifier_volume_test/closed_volume.h @@ -0,0 +1,615 @@ +const vec3 mesh_Cylinder_position[] = { + {0.000000, 1.000000, -1.000000}, + {0.000000, 1.000000, 1.000000}, + {0.195090, 0.980785, -1.000000}, + {0.195090, 0.980785, 1.000000}, + {0.382683, 0.923880, -1.000000}, + {0.382683, 0.923880, 1.000000}, + {0.555570, 0.831470, -1.000000}, + {0.555570, 0.831470, 1.000000}, + {0.707107, 0.707107, -1.000000}, + {0.707107, 0.707107, 1.000000}, + {0.831470, 0.555570, -1.000000}, + {0.831470, 0.555570, 1.000000}, + {0.923880, 0.382683, -1.000000}, + {0.923880, 0.382683, 1.000000}, + {0.980785, 0.195090, -1.000000}, + {0.980785, 0.195090, 1.000000}, + {1.000000, 0.000000, -1.000000}, + {1.000000, 0.000000, 1.000000}, + {0.980785, -0.195090, -1.000000}, + {0.980785, -0.195090, 1.000000}, + {0.923880, -0.382683, -1.000000}, + {0.923880, -0.382683, 1.000000}, + {0.831470, -0.555570, -1.000000}, + {0.831470, -0.555570, 1.000000}, + {0.707107, -0.707107, -1.000000}, + {0.707107, -0.707107, 1.000000}, + {0.555570, -0.831470, -1.000000}, + {0.555570, -0.831470, 1.000000}, + {0.382683, -0.923880, -1.000000}, + {0.382683, -0.923880, 1.000000}, + {0.195090, -0.980785, -1.000000}, + {0.195090, -0.980785, 1.000000}, + {0.000000, -1.000000, -1.000000}, + {0.000000, -1.000000, 1.000000}, + {-0.195090, -0.980785, -1.000000}, + {-0.195090, -0.980785, 1.000000}, + {-0.382683, -0.923880, -1.000000}, + {-0.382683, -0.923880, 1.000000}, + {-0.555570, -0.831470, -1.000000}, + {-0.555570, -0.831470, 1.000000}, + {-0.707107, -0.707107, -1.000000}, + {-0.707107, -0.707107, 1.000000}, + {-0.831470, -0.555570, -1.000000}, + {-0.831470, -0.555570, 1.000000}, + {-0.923880, -0.382683, -1.000000}, + {-0.923880, -0.382683, 1.000000}, + {-0.980785, -0.195090, -1.000000}, + {-0.980785, -0.195090, 1.000000}, + {-1.000000, 0.000000, -1.000000}, + {-1.000000, 0.000000, 1.000000}, + {-0.980785, 0.195090, -1.000000}, + {-0.980785, 0.195090, 1.000000}, + {-0.923880, 0.382683, -1.000000}, + {-0.923880, 0.382683, 1.000000}, + {-0.831470, 0.555570, -1.000000}, + {-0.831470, 0.555570, 1.000000}, + {-0.707107, 0.707107, -1.000000}, + {-0.707107, 0.707107, 1.000000}, + {-0.555570, 0.831470, -1.000000}, + {-0.555570, 0.831470, 1.000000}, + {-0.382683, 0.923880, -1.000000}, + {-0.382683, 0.923880, 1.000000}, + {-0.195090, 0.980785, -1.000000}, + {-0.195090, 0.980785, 1.000000}, + {-0.411373, 0.615663, 1.000000}, + {-0.283359, 0.684088, 1.000000}, + {-0.144455, 0.726224, 1.000000}, + {-0.726224, -0.144455, 1.000000}, + {-0.615663, -0.411373, 1.000000}, + {-0.684088, -0.283359, 1.000000}, + {0.144455, -0.726224, 1.000000}, + {0.411373, -0.615663, 1.000000}, + {0.283359, -0.684088, 1.000000}, + {0.615663, 0.411373, 1.000000}, + {0.726224, 0.144455, 1.000000}, + {0.684088, 0.283359, 1.000000}, + {-0.740452, 0.000000, 1.000000}, + {-0.726224, 0.144455, 1.000000}, + {-0.615663, 0.411373, 1.000000}, + {-0.684088, 0.283359, 1.000000}, + {-0.523579, 0.523579, 1.000000}, + {-0.411373, -0.615663, 1.000000}, + {0.000000, 0.740452, 1.000000}, + {0.283359, 0.684088, 1.000000}, + {0.144455, 0.726224, 1.000000}, + {-0.523579, -0.523579, 1.000000}, + {-0.283359, -0.684088, 1.000000}, + {-0.144455, -0.726224, 1.000000}, + {0.000000, -0.740452, 1.000000}, + {0.411373, 0.615663, 1.000000}, + {0.615663, -0.411373, 1.000000}, + {0.523579, 0.523579, 1.000000}, + {0.726224, -0.144455, 1.000000}, + {0.740452, 0.000000, 1.000000}, + {0.684088, -0.283359, 1.000000}, + {0.523579, -0.523579, 1.000000}, + {0.283359, 0.684088, -1.000000}, + {0.523579, 0.523579, -1.000000}, + {0.411373, 0.615663, -1.000000}, + {0.523579, -0.523579, -1.000000}, + {0.615663, -0.411373, -1.000000}, + {0.684088, -0.283359, -1.000000}, + {-0.523579, -0.523579, -1.000000}, + {-0.411373, -0.615663, -1.000000}, + {-0.283359, -0.684088, -1.000000}, + {-0.684088, 0.283359, -1.000000}, + {-0.523579, 0.523579, -1.000000}, + {-0.615663, 0.411373, -1.000000}, + {-0.144455, 0.726224, -1.000000}, + {0.000000, 0.740452, -1.000000}, + {0.144455, 0.726224, -1.000000}, + {0.283359, -0.684088, -1.000000}, + {0.684088, 0.283359, -1.000000}, + {0.615663, 0.411373, -1.000000}, + {0.740452, 0.000000, -1.000000}, + {0.726224, -0.144455, -1.000000}, + {0.726224, 0.144455, -1.000000}, + {0.411373, -0.615663, -1.000000}, + {-0.740452, 0.000000, -1.000000}, + {-0.726224, -0.144455, -1.000000}, + {-0.726224, 0.144455, -1.000000}, + {-0.615663, -0.411373, -1.000000}, + {-0.684088, -0.283359, -1.000000}, + {-0.283359, 0.684088, -1.000000}, + {-0.411373, 0.615663, -1.000000}, + {0.144455, -0.726224, -1.000000}, + {-0.144455, -0.726224, -1.000000}, + {0.000000, -0.740452, -1.000000}, +}; + +const vec2 mesh_Cylinder_UVMap_uvmap[] = { +}; + +const vec3 mesh_Cylinder_normal[] = { + {0.000000, 0.727878, -0.685707}, + {0.000000, 0.727878, 0.685707}, + {0.142002, 0.713892, -0.685707}, + {0.142002, 0.713892, 0.685707}, + {0.278547, 0.672471, -0.685707}, + {0.278547, 0.672471, 0.685707}, + {0.404387, 0.605208, -0.685707}, + {0.404387, 0.605208, 0.685707}, + {0.514687, 0.514687, -0.685707}, + {0.514687, 0.514687, 0.685707}, + {0.605208, 0.404387, -0.685707}, + {0.605208, 0.404387, 0.685707}, + {0.672471, 0.278547, -0.685707}, + {0.672471, 0.278547, 0.685707}, + {0.713892, 0.142002, -0.685707}, + {0.713892, 0.142002, 0.685707}, + {0.727878, 0.000000, -0.685707}, + {0.727878, 0.000000, 0.685707}, + {0.713892, -0.142002, -0.685707}, + {0.713892, -0.142002, 0.685707}, + {0.672471, -0.278547, -0.685707}, + {0.672471, -0.278547, 0.685707}, + {0.605208, -0.404387, -0.685707}, + {0.605208, -0.404387, 0.685707}, + {0.514687, -0.514687, -0.685707}, + {0.514687, -0.514687, 0.685707}, + {0.404387, -0.605208, -0.685707}, + {0.404387, -0.605208, 0.685707}, + {0.278547, -0.672471, -0.685707}, + {0.278547, -0.672471, 0.685707}, + {0.142002, -0.713892, -0.685707}, + {0.142002, -0.713892, 0.685707}, + {0.000000, -0.727878, -0.685707}, + {0.000000, -0.727878, 0.685707}, + {-0.142002, -0.713892, -0.685707}, + {-0.142002, -0.713892, 0.685707}, + {-0.278547, -0.672471, -0.685707}, + {-0.278547, -0.672471, 0.685707}, + {-0.404387, -0.605208, -0.685707}, + {-0.404387, -0.605208, 0.685707}, + {-0.514687, -0.514687, -0.685707}, + {-0.514687, -0.514687, 0.685707}, + {-0.605208, -0.404387, -0.685707}, + {-0.605208, -0.404387, 0.685707}, + {-0.672471, -0.278547, -0.685707}, + {-0.672471, -0.278547, 0.685707}, + {-0.713892, -0.142002, -0.685707}, + {-0.713892, -0.142002, 0.685707}, + {-0.727878, 0.000000, -0.685707}, + {-0.727878, 0.000000, 0.685707}, + {-0.713892, 0.142002, -0.685707}, + {-0.713892, 0.142002, 0.685707}, + {-0.672471, 0.278547, -0.685707}, + {-0.672471, 0.278547, 0.685707}, + {-0.605208, 0.404387, -0.685707}, + {-0.605208, 0.404387, 0.685707}, + {-0.514687, 0.514687, -0.685707}, + {-0.514687, 0.514687, 0.685707}, + {-0.404387, 0.605208, -0.685707}, + {-0.404387, 0.605208, 0.685707}, + {-0.278547, 0.672471, -0.685707}, + {-0.278547, 0.672471, 0.685707}, + {-0.142002, 0.713892, -0.685707}, + {-0.142002, 0.713892, 0.685707}, + {0.379798, -0.568408, 0.729840}, + {0.261609, -0.631581, 0.729840}, + {0.133367, -0.670483, 0.729840}, + {0.670483, 0.133367, 0.729840}, + {0.568408, 0.379798, 0.729840}, + {0.631581, 0.261609, 0.729840}, + {-0.133367, 0.670483, 0.729840}, + {-0.379798, 0.568408, 0.729840}, + {-0.261609, 0.631581, 0.729840}, + {-0.568408, -0.379798, 0.729840}, + {-0.670483, -0.133367, 0.729840}, + {-0.631581, -0.261609, 0.729840}, + {0.683618, 0.000000, 0.729840}, + {0.670483, -0.133367, 0.729840}, + {0.568408, -0.379798, 0.729840}, + {0.631581, -0.261609, 0.729840}, + {0.483391, -0.483391, 0.729840}, + {0.379798, 0.568408, 0.729840}, + {0.000000, -0.683618, 0.729840}, + {-0.261609, -0.631581, 0.729840}, + {-0.133367, -0.670483, 0.729840}, + {0.483391, 0.483391, 0.729840}, + {0.261609, 0.631581, 0.729840}, + {0.133367, 0.670483, 0.729840}, + {0.000000, 0.683618, 0.729840}, + {-0.379798, -0.568408, 0.729840}, + {-0.568408, 0.379798, 0.729840}, + {-0.483391, -0.483391, 0.729840}, + {-0.670483, 0.133367, 0.729840}, + {-0.683618, 0.000000, 0.729840}, + {-0.631581, 0.261609, 0.729840}, + {-0.483391, 0.483391, 0.729840}, + {-0.261609, -0.631581, -0.729840}, + {-0.483391, -0.483391, -0.729840}, + {-0.379798, -0.568408, -0.729840}, + {-0.483391, 0.483391, -0.729840}, + {-0.568408, 0.379798, -0.729840}, + {-0.631581, 0.261609, -0.729840}, + {0.483391, 0.483391, -0.729840}, + {0.379798, 0.568408, -0.729840}, + {0.261609, 0.631581, -0.729840}, + {0.631581, -0.261609, -0.729840}, + {0.483391, -0.483391, -0.729840}, + {0.568408, -0.379798, -0.729840}, + {0.133367, -0.670483, -0.729840}, + {0.000000, -0.683618, -0.729840}, + {-0.133367, -0.670483, -0.729840}, + {-0.261609, 0.631581, -0.729840}, + {-0.631581, -0.261609, -0.729840}, + {-0.568408, -0.379798, -0.729840}, + {-0.683618, 0.000000, -0.729840}, + {-0.670483, 0.133367, -0.729840}, + {-0.670483, -0.133367, -0.729840}, + {-0.379798, 0.568408, -0.729840}, + {0.683618, 0.000000, -0.729840}, + {0.670483, 0.133367, -0.729840}, + {0.670483, -0.133367, -0.729840}, + {0.568408, 0.379798, -0.729840}, + {0.631581, 0.261609, -0.729840}, + {0.261609, -0.631581, -0.729840}, + {0.379798, -0.568408, -0.729840}, + {-0.133367, 0.670483, -0.729840}, + {0.133367, 0.670483, -0.729840}, + {0.000000, 0.683618, -0.729840}, +}; + +const vec3 mesh_Cylinder_polygon_normal[] = { + {0.098017, 0.995185, 0.000000}, + {0.290285, 0.956940, 0.000000}, + {0.471397, 0.881921, 0.000000}, + {0.634393, 0.773010, 0.000000}, + {0.773010, 0.634393, 0.000000}, + {0.881921, 0.471397, 0.000000}, + {0.956940, 0.290285, 0.000000}, + {0.995185, 0.098017, 0.000000}, + {0.995185, -0.098017, 0.000000}, + {0.956940, -0.290285, 0.000000}, + {0.881921, -0.471397, 0.000000}, + {0.773010, -0.634393, 0.000000}, + {0.634393, -0.773010, 0.000000}, + {0.471397, -0.881921, 0.000000}, + {0.290285, -0.956940, 0.000000}, + {0.098017, -0.995185, 0.000000}, + {-0.098017, -0.995185, 0.000000}, + {-0.290285, -0.956940, 0.000000}, + {-0.471397, -0.881921, 0.000000}, + {-0.634393, -0.773010, 0.000000}, + {-0.773010, -0.634393, 0.000000}, + {-0.881921, -0.471397, 0.000000}, + {-0.956940, -0.290285, 0.000000}, + {-0.995185, -0.098017, 0.000000}, + {-0.995185, 0.098017, 0.000000}, + {-0.956940, 0.290285, 0.000000}, + {-0.881921, 0.471397, 0.000000}, + {-0.773010, 0.634393, 0.000000}, + {-0.634393, 0.773010, 0.000000}, + {-0.471397, 0.881921, 0.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {-0.290285, 0.956940, 0.000000}, + {-0.098017, 0.995185, 0.000000}, + {-0.098017, -0.995185, 0.000000}, + {-0.290285, -0.956940, 0.000000}, + {-0.471397, -0.881921, 0.000000}, + {-0.634393, -0.773010, 0.000000}, + {-0.773010, -0.634393, 0.000000}, + {-0.881921, -0.471397, 0.000000}, + {-0.956940, -0.290285, 0.000000}, + {-0.995185, -0.098017, 0.000000}, + {-0.995185, 0.098017, 0.000000}, + {-0.956940, 0.290285, 0.000000}, + {-0.881921, 0.471397, 0.000000}, + {-0.773010, 0.634393, 0.000000}, + {-0.634393, 0.773010, 0.000000}, + {-0.471397, 0.881921, 0.000000}, + {-0.290285, 0.956940, 0.000000}, + {-0.098017, 0.995185, 0.000000}, + {0.098017, 0.995185, 0.000000}, + {0.290285, 0.956940, 0.000000}, + {0.471397, 0.881921, 0.000000}, + {0.634393, 0.773010, 0.000000}, + {0.773010, 0.634393, 0.000000}, + {0.881921, 0.471397, 0.000000}, + {0.956940, 0.290285, 0.000000}, + {0.995185, 0.098017, 0.000000}, + {0.995185, -0.098017, 0.000000}, + {0.956940, -0.290285, 0.000000}, + {0.881921, -0.471397, 0.000000}, + {0.773010, -0.634393, 0.000000}, + {0.634393, -0.773010, 0.000000}, + {0.471397, -0.881921, 0.000000}, + {0.290285, -0.956940, 0.000000}, + {0.098017, -0.995185, 0.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, + {0.000000, 0.000000, -1.000000}, +}; + +const polygon mesh_Cylinder_polygons[] = { + {0, 1, 3, 2, 0, 0}, + {2, 3, 5, 4, 0, 4}, + {4, 5, 7, 6, 0, 8}, + {6, 7, 9, 8, 0, 12}, + {8, 9, 11, 10, 0, 16}, + {10, 11, 13, 12, 0, 20}, + {12, 13, 15, 14, 0, 24}, + {14, 15, 17, 16, 0, 28}, + {16, 17, 19, 18, 0, 32}, + {18, 19, 21, 20, 0, 36}, + {20, 21, 23, 22, 0, 40}, + {22, 23, 25, 24, 0, 44}, + {24, 25, 27, 26, 0, 48}, + {26, 27, 29, 28, 0, 52}, + {28, 29, 31, 30, 0, 56}, + {30, 31, 33, 32, 0, 60}, + {32, 33, 35, 34, 0, 64}, + {34, 35, 37, 36, 0, 68}, + {36, 37, 39, 38, 0, 72}, + {38, 39, 41, 40, 0, 76}, + {40, 41, 43, 42, 0, 80}, + {42, 43, 45, 44, 0, 84}, + {44, 45, 47, 46, 0, 88}, + {46, 47, 49, 48, 0, 92}, + {48, 49, 51, 50, 0, 96}, + {50, 51, 53, 52, 0, 100}, + {52, 53, 55, 54, 0, 104}, + {54, 55, 57, 56, 0, 108}, + {56, 57, 59, 58, 0, 112}, + {58, 59, 61, 60, 0, 116}, + {115, 114, 16, 18, 0, 120}, + {112, 113, 10, 12, 0, 124}, + {60, 61, 63, 62, 0, 128}, + {62, 63, 1, 0, 0, 132}, + {110, 84, 82, 109, 0, 136}, + {96, 83, 84, 110, 0, 140}, + {98, 89, 83, 96, 0, 144}, + {97, 91, 89, 98, 0, 148}, + {73, 91, 97, 113, 0, 152}, + {75, 73, 113, 112, 0, 156}, + {74, 75, 112, 116, 0, 160}, + {93, 74, 116, 114, 0, 164}, + {92, 93, 114, 115, 0, 168}, + {94, 92, 115, 101, 0, 172}, + {90, 94, 101, 100, 0, 176}, + {95, 90, 100, 99, 0, 180}, + {71, 95, 99, 117, 0, 184}, + {72, 71, 117, 111, 0, 188}, + {70, 72, 111, 125, 0, 192}, + {88, 70, 125, 127, 0, 196}, + {87, 88, 127, 126, 0, 200}, + {86, 87, 126, 104, 0, 204}, + {81, 86, 104, 103, 0, 208}, + {85, 81, 103, 102, 0, 212}, + {121, 68, 85, 102, 0, 216}, + {122, 69, 68, 121, 0, 220}, + {119, 67, 69, 122, 0, 224}, + {118, 76, 67, 119, 0, 228}, + {120, 77, 76, 118, 0, 232}, + {105, 79, 77, 120, 0, 236}, + {107, 78, 79, 105, 0, 240}, + {106, 80, 78, 107, 0, 244}, + {124, 64, 80, 106, 0, 248}, + {123, 65, 64, 124, 0, 252}, + {108, 66, 65, 123, 0, 256}, + {109, 82, 66, 108, 0, 260}, + {13, 11, 73, 75, 0, 264}, + {90, 95, 25, 23, 0, 268}, + {91, 73, 11, 9, 0, 272}, + {114, 116, 14, 16, 0, 276}, + {13, 75, 74, 15, 0, 280}, + {74, 93, 17, 15, 0, 284}, + {1, 82, 84, 3, 0, 288}, + {3, 84, 83, 5, 0, 292}, + {10, 113, 97, 8, 0, 296}, + {100, 101, 20, 22, 0, 300}, + {8, 97, 98, 6, 0, 304}, + {0, 109, 108, 62, 0, 308}, + {83, 89, 7, 5, 0, 312}, + {117, 99, 24, 26, 0, 316}, + {89, 91, 9, 7, 0, 320}, + {57, 80, 64, 59, 0, 324}, + {64, 65, 61, 59, 0, 328}, + {65, 66, 63, 61, 0, 332}, + {63, 66, 82, 1, 0, 336}, + {76, 77, 51, 49, 0, 340}, + {77, 79, 53, 51, 0, 344}, + {104, 126, 34, 36, 0, 348}, + {53, 79, 78, 55, 0, 352}, + {55, 78, 80, 57, 0, 356}, + {85, 68, 43, 41, 0, 360}, + {68, 69, 45, 43, 0, 364}, + {69, 67, 47, 45, 0, 368}, + {67, 76, 49, 47, 0, 372}, + {88, 87, 35, 33, 0, 376}, + {87, 86, 37, 35, 0, 380}, + {37, 86, 81, 39, 0, 384}, + {81, 85, 41, 39, 0, 388}, + {92, 94, 21, 19, 0, 392}, + {94, 90, 23, 21, 0, 396}, + {29, 72, 70, 31, 0, 400}, + {31, 70, 88, 33, 0, 404}, + {27, 71, 72, 29, 0, 408}, + {93, 92, 19, 17, 0, 412}, + {96, 110, 2, 4, 0, 416}, + {126, 127, 32, 34, 0, 420}, + {116, 112, 12, 14, 0, 424}, + {20, 101, 115, 18, 0, 428}, + {103, 104, 36, 38, 0, 432}, + {40, 102, 103, 38, 0, 436}, + {2, 110, 109, 0, 0, 440}, + {25, 95, 71, 27, 0, 444}, + {118, 119, 46, 48, 0, 448}, + {119, 122, 44, 46, 0, 452}, + {44, 122, 121, 42, 0, 456}, + {42, 121, 102, 40, 0, 460}, + {106, 107, 54, 56, 0, 464}, + {54, 107, 105, 52, 0, 468}, + {105, 120, 50, 52, 0, 472}, + {120, 118, 48, 50, 0, 476}, + {6, 98, 96, 4, 0, 480}, + {62, 108, 123, 60, 0, 484}, + {60, 123, 124, 58, 0, 488}, + {124, 106, 56, 58, 0, 492}, + {30, 125, 111, 28, 0, 496}, + {111, 117, 26, 28, 0, 500}, + {30, 32, 127, 125, 0, 504}, + {99, 100, 22, 24, 0, 508}, +}; + +const mesh_material mesh_Cylinder_materials[] = { +}; +const vec2 * mesh_Cylinder_uv_layers[] = { + mesh_Cylinder_UVMap_uvmap, +}; + +const mesh mesh_Cylinder = { + .position = mesh_Cylinder_position, + .position_length = (sizeof (mesh_Cylinder_position)) / (sizeof (mesh_Cylinder_position[0])), + .normal = mesh_Cylinder_normal, + .normal_length = (sizeof (mesh_Cylinder_normal)) / (sizeof (mesh_Cylinder_normal[0])), + .polygon_normal = mesh_Cylinder_polygon_normal, + .polygon_normal_length = (sizeof (mesh_Cylinder_polygon_normal)) / (sizeof (mesh_Cylinder_polygon_normal[0])), + .polygons = mesh_Cylinder_polygons, + .polygons_length = (sizeof (mesh_Cylinder_polygons)) / (sizeof (mesh_Cylinder_polygons[0])), + .uv_layers = mesh_Cylinder_uv_layers, + .uv_layers_length = (sizeof (mesh_Cylinder_uv_layers)) / (sizeof (mesh_Cylinder_uv_layers[0])), + .materials = mesh_Cylinder_materials, + .materials_length = (sizeof (mesh_Cylinder_materials)) / (sizeof (mesh_Cylinder_materials[0])), +}; + +const vec3 mesh_Plane_position[] = { + {-1.000000, -1.000000, 0.000000}, + {1.000000, -1.000000, 0.000000}, + {-1.000000, 1.000000, 0.000000}, + {1.000000, 1.000000, 0.000000}, +}; + +const vec2 mesh_Plane_UVMap_uvmap[] = { + {0.000000, 0.000000}, + {1.000000, 0.000000}, + {1.000000, 1.000000}, + {0.000000, 1.000000}, +}; + +const vec3 mesh_Plane_normal[] = { + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, +}; + +const vec3 mesh_Plane_polygon_normal[] = { + {0.000000, 0.000000, 1.000000}, +}; + +const polygon mesh_Plane_polygons[] = { + {0, 1, 3, 2, 0, 0}, +}; + +const mesh_material mesh_Plane_materials[] = { +}; +const vec2 * mesh_Plane_uv_layers[] = { + mesh_Plane_UVMap_uvmap, +}; + +const mesh mesh_Plane = { + .position = mesh_Plane_position, + .position_length = (sizeof (mesh_Plane_position)) / (sizeof (mesh_Plane_position[0])), + .normal = mesh_Plane_normal, + .normal_length = (sizeof (mesh_Plane_normal)) / (sizeof (mesh_Plane_normal[0])), + .polygon_normal = mesh_Plane_polygon_normal, + .polygon_normal_length = (sizeof (mesh_Plane_polygon_normal)) / (sizeof (mesh_Plane_polygon_normal[0])), + .polygons = mesh_Plane_polygons, + .polygons_length = (sizeof (mesh_Plane_polygons)) / (sizeof (mesh_Plane_polygons[0])), + .uv_layers = mesh_Plane_uv_layers, + .uv_layers_length = (sizeof (mesh_Plane_uv_layers)) / (sizeof (mesh_Plane_uv_layers[0])), + .materials = mesh_Plane_materials, + .materials_length = (sizeof (mesh_Plane_materials)) / (sizeof (mesh_Plane_materials[0])), +}; + +const object objects[] = { + { // object_Cylinder + .mesh = &mesh_Cylinder, + .scale = {1.000000, 1.000000, 1.000000}, + .rotation = {0.000000, 0.000000, 0.000000, 1.000000}, // quaternion (XYZW) + .location = {0.000000, 0.000000, 0.000000}, + }, + { // object_Plane + .mesh = &mesh_Plane, + .scale = {2.000000, 2.000000, 2.000000}, + .rotation = {0.000000, 0.000000, 0.000000, 1.000000}, // quaternion (XYZW) + .location = {0.000000, 0.000000, 0.000000}, + }, +}; + +const material materials[] = { +}; diff --git a/model/modifier_volume_test/open_volume.blend b/model/modifier_volume_test/open_volume.blend new file mode 100644 index 0000000..0a470c4 Binary files /dev/null and b/model/modifier_volume_test/open_volume.blend differ diff --git a/model/modifier_volume_test/open_volume.h b/model/modifier_volume_test/open_volume.h new file mode 100644 index 0000000..9a5d34a --- /dev/null +++ b/model/modifier_volume_test/open_volume.h @@ -0,0 +1,487 @@ +const vec3 mesh_Cylinder_position[] = { + {0.000000, 1.000000, -1.000000}, + {0.000000, 1.000000, 1.000000}, + {0.195090, 0.980785, -1.000000}, + {0.195090, 0.980785, 1.000000}, + {0.382683, 0.923880, -1.000000}, + {0.382683, 0.923880, 1.000000}, + {0.555570, 0.831470, -1.000000}, + {0.555570, 0.831470, 1.000000}, + {0.707107, 0.707107, -1.000000}, + {0.707107, 0.707107, 1.000000}, + {0.831470, 0.555570, -1.000000}, + {0.831470, 0.555570, 1.000000}, + {0.923880, 0.382683, -1.000000}, + {0.923880, 0.382683, 1.000000}, + {0.980785, 0.195090, -1.000000}, + {0.980785, 0.195090, 1.000000}, + {1.000000, 0.000000, -1.000000}, + {1.000000, 0.000000, 1.000000}, + {0.980785, -0.195090, -1.000000}, + {0.980785, -0.195090, 1.000000}, + {0.923880, -0.382683, -1.000000}, + {0.923880, -0.382683, 1.000000}, + {0.831470, -0.555570, -1.000000}, + {0.831470, -0.555570, 1.000000}, + {0.707107, -0.707107, -1.000000}, + {0.707107, -0.707107, 1.000000}, + {0.555570, -0.831470, -1.000000}, + {0.555570, -0.831470, 1.000000}, + {0.382683, -0.923880, -1.000000}, + {0.382683, -0.923880, 1.000000}, + {0.195090, -0.980785, -1.000000}, + {0.195090, -0.980785, 1.000000}, + {0.000000, -1.000000, -1.000000}, + {0.000000, -1.000000, 1.000000}, + {-0.195090, -0.980785, -1.000000}, + {-0.195090, -0.980785, 1.000000}, + {-0.382683, -0.923880, -1.000000}, + {-0.382683, -0.923880, 1.000000}, + {-0.555570, -0.831470, -1.000000}, + {-0.555570, -0.831470, 1.000000}, + {-0.707107, -0.707107, -1.000000}, + {-0.707107, -0.707107, 1.000000}, + {-0.831470, -0.555570, -1.000000}, + {-0.831470, -0.555570, 1.000000}, + {-0.923880, -0.382683, -1.000000}, + {-0.923880, -0.382683, 1.000000}, + {-0.980785, -0.195090, -1.000000}, + {-0.980785, -0.195090, 1.000000}, + {-1.000000, 0.000000, -1.000000}, + {-1.000000, 0.000000, 1.000000}, + {-0.980785, 0.195090, -1.000000}, + {-0.980785, 0.195090, 1.000000}, + {-0.923880, 0.382683, -1.000000}, + {-0.923880, 0.382683, 1.000000}, + {-0.831470, 0.555570, -1.000000}, + {-0.831470, 0.555570, 1.000000}, + {-0.707107, 0.707107, -1.000000}, + {-0.707107, 0.707107, 1.000000}, + {-0.555570, 0.831470, -1.000000}, + {-0.555570, 0.831470, 1.000000}, + {-0.382683, 0.923880, -1.000000}, + {-0.382683, 0.923880, 1.000000}, + {-0.195090, 0.980785, -1.000000}, + {-0.195090, 0.980785, 1.000000}, + {-0.411373, 0.615663, 1.000000}, + {-0.283359, 0.684088, 1.000000}, + {-0.144455, 0.726224, 1.000000}, + {-0.726224, -0.144455, 1.000000}, + {-0.615663, -0.411373, 1.000000}, + {-0.684088, -0.283359, 1.000000}, + {0.144455, -0.726224, 1.000000}, + {0.411373, -0.615663, 1.000000}, + {0.283359, -0.684088, 1.000000}, + {0.615663, 0.411373, 1.000000}, + {0.726224, 0.144455, 1.000000}, + {0.684088, 0.283359, 1.000000}, + {-0.740452, 0.000000, 1.000000}, + {-0.726224, 0.144455, 1.000000}, + {-0.615663, 0.411373, 1.000000}, + {-0.684088, 0.283359, 1.000000}, + {-0.523579, 0.523579, 1.000000}, + {-0.411373, -0.615663, 1.000000}, + {0.000000, 0.740452, 1.000000}, + {0.283359, 0.684088, 1.000000}, + {0.144455, 0.726224, 1.000000}, + {-0.523579, -0.523579, 1.000000}, + {-0.283359, -0.684088, 1.000000}, + {-0.144455, -0.726224, 1.000000}, + {0.000000, -0.740452, 1.000000}, + {0.411373, 0.615663, 1.000000}, + {0.615663, -0.411373, 1.000000}, + {0.523579, 0.523579, 1.000000}, + {0.726224, -0.144455, 1.000000}, + {0.740452, 0.000000, 1.000000}, + {0.684088, -0.283359, 1.000000}, + {0.523579, -0.523579, 1.000000}, + {0.283359, 0.684088, -1.000000}, + {0.523579, 0.523579, -1.000000}, + {0.411373, 0.615663, -1.000000}, + {0.523579, -0.523579, -1.000000}, + {0.615663, -0.411373, -1.000000}, + {0.684088, -0.283359, -1.000000}, + {-0.523579, -0.523579, -1.000000}, + {-0.411373, -0.615663, -1.000000}, + {-0.283359, -0.684088, -1.000000}, + {-0.684088, 0.283359, -1.000000}, + {-0.523579, 0.523579, -1.000000}, + {-0.615663, 0.411373, -1.000000}, + {-0.144455, 0.726224, -1.000000}, + {0.000000, 0.740452, -1.000000}, + {0.144455, 0.726224, -1.000000}, + {0.283359, -0.684088, -1.000000}, + {0.684088, 0.283359, -1.000000}, + {0.615663, 0.411373, -1.000000}, + {0.740452, 0.000000, -1.000000}, + {0.726224, -0.144455, -1.000000}, + {0.726224, 0.144455, -1.000000}, + {0.411373, -0.615663, -1.000000}, + {-0.740452, 0.000000, -1.000000}, + {-0.726224, -0.144455, -1.000000}, + {-0.726224, 0.144455, -1.000000}, + {-0.615663, -0.411373, -1.000000}, + {-0.684088, -0.283359, -1.000000}, + {-0.283359, 0.684088, -1.000000}, + {-0.411373, 0.615663, -1.000000}, + {0.144455, -0.726224, -1.000000}, + {-0.144455, -0.726224, -1.000000}, + {0.000000, -0.740452, -1.000000}, +}; + +const vec2 mesh_Cylinder_UVMap_uvmap[] = { +}; + +const vec3 mesh_Cylinder_normal[] = { + {0.000000, 1.000000, 0.000000}, + {0.000000, 1.000000, 0.000000}, + {0.195090, 0.980785, 0.000000}, + {0.195090, 0.980785, 0.000000}, + {0.382683, 0.923880, 0.000000}, + {0.382683, 0.923880, 0.000000}, + {0.555570, 0.831470, 0.000000}, + {0.555570, 0.831470, 0.000000}, + {0.707107, 0.707107, 0.000000}, + {0.707107, 0.707107, 0.000000}, + {0.831470, 0.555570, 0.000000}, + {0.831470, 0.555570, 0.000000}, + {0.923880, 0.382683, 0.000000}, + {0.923880, 0.382683, 0.000000}, + {0.980785, 0.195090, 0.000000}, + {0.980785, 0.195090, 0.000000}, + {1.000000, 0.000000, 0.000000}, + {1.000000, 0.000000, 0.000000}, + {0.980785, -0.195090, 0.000000}, + {0.980785, -0.195090, 0.000000}, + {0.923880, -0.382683, 0.000000}, + {0.923880, -0.382683, 0.000000}, + {0.831470, -0.555570, 0.000000}, + {0.831470, -0.555570, 0.000000}, + {0.707107, -0.707107, 0.000000}, + {0.707107, -0.707107, 0.000000}, + {0.555570, -0.831470, 0.000000}, + {0.555570, -0.831470, 0.000000}, + {0.382683, -0.923880, 0.000000}, + {0.382683, -0.923880, 0.000000}, + {0.195090, -0.980785, 0.000000}, + {0.195090, -0.980785, 0.000000}, + {0.000000, -1.000000, 0.000000}, + {0.000000, -1.000000, 0.000000}, + {-0.195090, -0.980785, 0.000000}, + {-0.195090, -0.980785, 0.000000}, + {-0.382683, -0.923880, 0.000000}, + {-0.382683, -0.923880, 0.000000}, + {-0.555570, -0.831470, 0.000000}, + {-0.555570, -0.831470, 0.000000}, + {-0.707107, -0.707107, 0.000000}, + {-0.707107, -0.707107, 0.000000}, + {-0.831470, -0.555570, 0.000000}, + {-0.831470, -0.555570, 0.000000}, + {-0.923880, -0.382683, 0.000000}, + {-0.923880, -0.382683, 0.000000}, + {-0.980785, -0.195090, 0.000000}, + {-0.980785, -0.195090, 0.000000}, + {-1.000000, 0.000000, 0.000000}, + {-1.000000, 0.000000, 0.000000}, + {-0.980785, 0.195090, 0.000000}, + {-0.980785, 0.195090, 0.000000}, + {-0.923880, 0.382683, 0.000000}, + {-0.923880, 0.382683, 0.000000}, + {-0.831470, 0.555570, 0.000000}, + {-0.831470, 0.555570, 0.000000}, + {-0.707107, 0.707107, 0.000000}, + {-0.707107, 0.707107, 0.000000}, + {-0.555570, 0.831470, 0.000000}, + {-0.555570, 0.831470, 0.000000}, + {-0.382683, 0.923880, 0.000000}, + {-0.382683, 0.923880, 0.000000}, + {-0.195090, 0.980785, 0.000000}, + {-0.195090, 0.980785, 0.000000}, + {0.555570, -0.831470, 0.000000}, + {0.382683, -0.923880, 0.000000}, + {0.195090, -0.980785, 0.000000}, + {0.980785, 0.195090, 0.000000}, + {0.831470, 0.555570, 0.000000}, + {0.923880, 0.382683, 0.000000}, + {-0.195090, 0.980785, 0.000000}, + {-0.555570, 0.831470, 0.000000}, + {-0.382683, 0.923880, 0.000000}, + {-0.831470, -0.555570, 0.000000}, + {-0.980785, -0.195090, 0.000000}, + {-0.923880, -0.382683, 0.000000}, + {1.000000, 0.000000, 0.000000}, + {0.980785, -0.195090, 0.000000}, + {0.831470, -0.555570, 0.000000}, + {0.923880, -0.382683, 0.000000}, + {0.707107, -0.707107, 0.000000}, + {0.555570, 0.831470, 0.000000}, + {0.000000, -1.000000, 0.000000}, + {-0.382683, -0.923880, 0.000000}, + {-0.195090, -0.980785, 0.000000}, + {0.707107, 0.707107, 0.000000}, + {0.382683, 0.923880, 0.000000}, + {0.195090, 0.980785, 0.000000}, + {0.000000, 1.000000, 0.000000}, + {-0.555570, -0.831470, 0.000000}, + {-0.831470, 0.555570, 0.000000}, + {-0.707107, -0.707107, 0.000000}, + {-0.980785, 0.195090, 0.000000}, + {-1.000000, 0.000000, 0.000000}, + {-0.923880, 0.382683, 0.000000}, + {-0.707107, 0.707107, 0.000000}, + {-0.382683, -0.923880, 0.000000}, + {-0.707107, -0.707107, 0.000000}, + {-0.555570, -0.831470, 0.000000}, + {-0.707107, 0.707107, 0.000000}, + {-0.831470, 0.555570, 0.000000}, + {-0.923880, 0.382683, 0.000000}, + {0.707107, 0.707107, 0.000000}, + {0.555570, 0.831470, 0.000000}, + {0.382683, 0.923880, 0.000000}, + {0.923880, -0.382683, 0.000000}, + {0.707107, -0.707107, 0.000000}, + {0.831470, -0.555570, 0.000000}, + {0.195090, -0.980785, 0.000000}, + {0.000000, -1.000000, 0.000000}, + {-0.195090, -0.980785, 0.000000}, + {-0.382683, 0.923880, 0.000000}, + {-0.923880, -0.382683, 0.000000}, + {-0.831470, -0.555570, 0.000000}, + {-1.000000, 0.000000, 0.000000}, + {-0.980785, 0.195090, 0.000000}, + {-0.980785, -0.195090, 0.000000}, + {-0.555570, 0.831470, 0.000000}, + {1.000000, 0.000000, 0.000000}, + {0.980785, 0.195090, 0.000000}, + {0.980785, -0.195090, 0.000000}, + {0.831470, 0.555570, 0.000000}, + {0.923880, 0.382683, 0.000000}, + {0.382683, -0.923880, 0.000000}, + {0.555570, -0.831470, 0.000000}, + {-0.195090, 0.980785, 0.000000}, + {0.195090, 0.980785, 0.000000}, + {0.000000, 1.000000, 0.000000}, +}; + +const vec3 mesh_Cylinder_polygon_normal[] = { + {0.098017, 0.995185, 0.000000}, + {0.290285, 0.956940, 0.000000}, + {0.471397, 0.881921, 0.000000}, + {0.634393, 0.773010, 0.000000}, + {0.773010, 0.634393, 0.000000}, + {0.881921, 0.471397, 0.000000}, + {0.956940, 0.290285, 0.000000}, + {0.995185, 0.098017, 0.000000}, + {0.995185, -0.098017, 0.000000}, + {0.956940, -0.290285, 0.000000}, + {0.881921, -0.471397, 0.000000}, + {0.773010, -0.634393, 0.000000}, + {0.634393, -0.773010, 0.000000}, + {0.471397, -0.881921, 0.000000}, + {0.290285, -0.956940, 0.000000}, + {0.098017, -0.995185, 0.000000}, + {-0.098017, -0.995185, 0.000000}, + {-0.290285, -0.956940, 0.000000}, + {-0.471397, -0.881921, 0.000000}, + {-0.634393, -0.773010, 0.000000}, + {-0.773010, -0.634393, 0.000000}, + {-0.881921, -0.471397, 0.000000}, + {-0.956940, -0.290285, 0.000000}, + {-0.995185, -0.098017, 0.000000}, + {-0.995185, 0.098017, 0.000000}, + {-0.956940, 0.290285, 0.000000}, + {-0.881921, 0.471397, 0.000000}, + {-0.773010, 0.634393, 0.000000}, + {-0.634393, 0.773010, 0.000000}, + {-0.471397, 0.881921, 0.000000}, + {-0.290285, 0.956940, 0.000000}, + {-0.098017, 0.995185, 0.000000}, + {-0.098017, -0.995185, 0.000000}, + {-0.290285, -0.956940, 0.000000}, + {-0.471397, -0.881921, 0.000000}, + {-0.634393, -0.773010, 0.000000}, + {-0.773010, -0.634393, 0.000000}, + {-0.881921, -0.471397, 0.000000}, + {-0.956940, -0.290285, 0.000000}, + {-0.995185, -0.098017, 0.000000}, + {-0.995185, 0.098017, 0.000000}, + {-0.956940, 0.290285, 0.000000}, + {-0.881921, 0.471397, 0.000000}, + {-0.773010, 0.634393, 0.000000}, + {-0.634393, 0.773010, 0.000000}, + {-0.471397, 0.881921, 0.000000}, + {-0.290285, 0.956940, 0.000000}, + {-0.098017, 0.995185, 0.000000}, + {0.098017, 0.995185, 0.000000}, + {0.290285, 0.956940, 0.000000}, + {0.471397, 0.881921, 0.000000}, + {0.634393, 0.773010, 0.000000}, + {0.773010, 0.634393, 0.000000}, + {0.881921, 0.471397, 0.000000}, + {0.956940, 0.290285, 0.000000}, + {0.995185, 0.098017, 0.000000}, + {0.995185, -0.098017, 0.000000}, + {0.956940, -0.290285, 0.000000}, + {0.881921, -0.471397, 0.000000}, + {0.773010, -0.634393, 0.000000}, + {0.634393, -0.773010, 0.000000}, + {0.471397, -0.881921, 0.000000}, + {0.290285, -0.956940, 0.000000}, + {0.098017, -0.995185, 0.000000}, +}; + +const polygon mesh_Cylinder_polygons[] = { + {0, 1, 3, 2, 0, 0}, + {2, 3, 5, 4, 0, 4}, + {4, 5, 7, 6, 0, 8}, + {6, 7, 9, 8, 0, 12}, + {8, 9, 11, 10, 0, 16}, + {10, 11, 13, 12, 0, 20}, + {12, 13, 15, 14, 0, 24}, + {14, 15, 17, 16, 0, 28}, + {16, 17, 19, 18, 0, 32}, + {18, 19, 21, 20, 0, 36}, + {20, 21, 23, 22, 0, 40}, + {22, 23, 25, 24, 0, 44}, + {24, 25, 27, 26, 0, 48}, + {26, 27, 29, 28, 0, 52}, + {28, 29, 31, 30, 0, 56}, + {30, 31, 33, 32, 0, 60}, + {32, 33, 35, 34, 0, 64}, + {34, 35, 37, 36, 0, 68}, + {36, 37, 39, 38, 0, 72}, + {38, 39, 41, 40, 0, 76}, + {40, 41, 43, 42, 0, 80}, + {42, 43, 45, 44, 0, 84}, + {44, 45, 47, 46, 0, 88}, + {46, 47, 49, 48, 0, 92}, + {48, 49, 51, 50, 0, 96}, + {50, 51, 53, 52, 0, 100}, + {52, 53, 55, 54, 0, 104}, + {54, 55, 57, 56, 0, 108}, + {56, 57, 59, 58, 0, 112}, + {58, 59, 61, 60, 0, 116}, + {60, 61, 63, 62, 0, 120}, + {62, 63, 1, 0, 0, 124}, + {110, 84, 82, 109, 0, 128}, + {96, 83, 84, 110, 0, 132}, + {98, 89, 83, 96, 0, 136}, + {97, 91, 89, 98, 0, 140}, + {73, 91, 97, 113, 0, 144}, + {75, 73, 113, 112, 0, 148}, + {74, 75, 112, 116, 0, 152}, + {93, 74, 116, 114, 0, 156}, + {92, 93, 114, 115, 0, 160}, + {94, 92, 115, 101, 0, 164}, + {90, 94, 101, 100, 0, 168}, + {95, 90, 100, 99, 0, 172}, + {71, 95, 99, 117, 0, 176}, + {72, 71, 117, 111, 0, 180}, + {70, 72, 111, 125, 0, 184}, + {88, 70, 125, 127, 0, 188}, + {87, 88, 127, 126, 0, 192}, + {86, 87, 126, 104, 0, 196}, + {81, 86, 104, 103, 0, 200}, + {85, 81, 103, 102, 0, 204}, + {121, 68, 85, 102, 0, 208}, + {122, 69, 68, 121, 0, 212}, + {119, 67, 69, 122, 0, 216}, + {118, 76, 67, 119, 0, 220}, + {120, 77, 76, 118, 0, 224}, + {105, 79, 77, 120, 0, 228}, + {107, 78, 79, 105, 0, 232}, + {106, 80, 78, 107, 0, 236}, + {124, 64, 80, 106, 0, 240}, + {123, 65, 64, 124, 0, 244}, + {108, 66, 65, 123, 0, 248}, + {109, 82, 66, 108, 0, 252}, +}; + +const mesh_material mesh_Cylinder_materials[] = { +}; +const vec2 * mesh_Cylinder_uv_layers[] = { + mesh_Cylinder_UVMap_uvmap, +}; + +const mesh mesh_Cylinder = { + .position = mesh_Cylinder_position, + .position_length = (sizeof (mesh_Cylinder_position)) / (sizeof (mesh_Cylinder_position[0])), + .normal = mesh_Cylinder_normal, + .normal_length = (sizeof (mesh_Cylinder_normal)) / (sizeof (mesh_Cylinder_normal[0])), + .polygon_normal = mesh_Cylinder_polygon_normal, + .polygon_normal_length = (sizeof (mesh_Cylinder_polygon_normal)) / (sizeof (mesh_Cylinder_polygon_normal[0])), + .polygons = mesh_Cylinder_polygons, + .polygons_length = (sizeof (mesh_Cylinder_polygons)) / (sizeof (mesh_Cylinder_polygons[0])), + .uv_layers = mesh_Cylinder_uv_layers, + .uv_layers_length = (sizeof (mesh_Cylinder_uv_layers)) / (sizeof (mesh_Cylinder_uv_layers[0])), + .materials = mesh_Cylinder_materials, + .materials_length = (sizeof (mesh_Cylinder_materials)) / (sizeof (mesh_Cylinder_materials[0])), +}; + +const vec3 mesh_Plane_position[] = { + {-1.000000, -1.000000, 0.000000}, + {1.000000, -1.000000, 0.000000}, + {-1.000000, 1.000000, 0.000000}, + {1.000000, 1.000000, 0.000000}, +}; + +const vec2 mesh_Plane_UVMap_uvmap[] = { + {0.000000, 0.000000}, + {1.000000, 0.000000}, + {1.000000, 1.000000}, + {0.000000, 1.000000}, +}; + +const vec3 mesh_Plane_normal[] = { + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, + {0.000000, 0.000000, 1.000000}, +}; + +const vec3 mesh_Plane_polygon_normal[] = { + {0.000000, 0.000000, 1.000000}, +}; + +const polygon mesh_Plane_polygons[] = { + {0, 1, 3, 2, 0, 0}, +}; + +const mesh_material mesh_Plane_materials[] = { +}; +const vec2 * mesh_Plane_uv_layers[] = { + mesh_Plane_UVMap_uvmap, +}; + +const mesh mesh_Plane = { + .position = mesh_Plane_position, + .position_length = (sizeof (mesh_Plane_position)) / (sizeof (mesh_Plane_position[0])), + .normal = mesh_Plane_normal, + .normal_length = (sizeof (mesh_Plane_normal)) / (sizeof (mesh_Plane_normal[0])), + .polygon_normal = mesh_Plane_polygon_normal, + .polygon_normal_length = (sizeof (mesh_Plane_polygon_normal)) / (sizeof (mesh_Plane_polygon_normal[0])), + .polygons = mesh_Plane_polygons, + .polygons_length = (sizeof (mesh_Plane_polygons)) / (sizeof (mesh_Plane_polygons[0])), + .uv_layers = mesh_Plane_uv_layers, + .uv_layers_length = (sizeof (mesh_Plane_uv_layers)) / (sizeof (mesh_Plane_uv_layers[0])), + .materials = mesh_Plane_materials, + .materials_length = (sizeof (mesh_Plane_materials)) / (sizeof (mesh_Plane_materials[0])), +}; + +const object objects[] = { + { // object_Cylinder + .mesh = &mesh_Cylinder, + .scale = {1.000000, 1.000000, 1.000000}, + .rotation = {0.000000, 0.000000, 0.000000, 1.000000}, // quaternion (XYZW) + .location = {0.000000, 0.000000, 0.000000}, + }, + { // object_Plane + .mesh = &mesh_Plane, + .scale = {2.000000, 2.000000, 2.000000}, + .rotation = {0.000000, 0.000000, 0.000000, 1.000000}, // quaternion (XYZW) + .location = {0.000000, 0.000000, 0.000000}, + }, +}; + +const material materials[] = { +};