diff --git a/Makefile b/Makefile index 1b1b4f1..68a43c8 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,11 @@ SHADERS = \ $(BUILD_TYPE)/effect/collada.fxo \ $(BUILD_TYPE)/effect/collada_scene.fxo -$(BUILD_TYPE)/%.res: %.rc $(SHADERS) +BUFFERS = \ + models/curve_interpolation/curve_interpolation.vtx \ + models/curve_interpolation/curve_interpolation.idx + +$(BUILD_TYPE)/%.res: %.rc $(SHADERS) $(BUFFERS) @mkdir -p $(@D) $(WINDRES) -O coff -I$(BUILD_TYPE)/effect -o $@ $< @@ -67,7 +71,8 @@ OBJS = \ $(BUILD_TYPE)/render_state.obj \ $(BUILD_TYPE)/input.obj \ $(BUILD_TYPE)/collada.obj \ - $(BUILD_TYPE)/collada_scene.obj + $(BUILD_TYPE)/collada_scene.obj \ + $(BUILD_TYPE)/scenes/curve_interpolation.obj $(BUILD_TYPE)/d3d10.exe: $(OBJS) @mkdir -p $(@D) diff --git a/collada/header.py b/collada/header.py index 56a8281..27cc51e 100644 --- a/collada/header.py +++ b/collada/header.py @@ -475,8 +475,10 @@ def render_input_elements_list(state): yield "}," yield "};" -def render_descriptor(): - yield "descriptor const descriptor = {" +def render_descriptor(namespace): + yield f"extern collada::descriptor const descriptor;" + yield "" + yield "collada::descriptor const descriptor = {" yield ".nodes = nodes," yield ".nodes_count = (sizeof (nodes)) / (sizeof (nodes[0]))," yield "" @@ -494,18 +496,6 @@ def render_animation_children(state, collada, animation_name, animations): yield "&animation_{animation_name}," yield "};" -def array_c_type(accessor): - if accessor.params[0].name == "INTERPOLATION": - return "interpolation" - assert all(param.type == "float" for param in accessor.params) - if accessor.stride == 1: - return "float" - elif accessor.stride in {2, 3, 4}: - assert list(param.name for param in accessor.params) == ["X", "Y", "Z", "W"][:accessor.stride], accessor.params - return f"float{accessor.stride}" - else: - assert False, accessor.stride - def render_array(state, collada, accessor, array): array_name = sanitize_name(state, array.id, array) # render the array @@ -518,30 +508,26 @@ def render_array(state, collada, accessor, array): assert name in {"BEZIER", "LINEAR"}, name yield f"interpolation::{name}," yield "};" - return "interpolation" elif type(array) is types.FloatArray: - c_type = array_c_type(accessor) - yield f"{c_type} const array_{array_name}[] = {{" + yield f"float const array_{array_name}[] = {{" it = iter(array.floats) for i in range(accessor.count): vector = ", ".join(f"{float(f)}f" for f in islice(it, accessor.stride)) - if accessor.stride == 1: - yield f"{vector}," - else: - yield f"{{ {vector} }}," + yield f"{vector}," yield "};" else: assert False, type(array) def render_source(state, collada, field_name, source): array_name = sanitize_name(state, source.array_element.id, source.array_element) - c_type = array_c_type(source.technique_common.accessor) + c_type = "interpolation" if type(source.array_element) is types.NameArray else "float" source_name = sanitize_name(state, source.id, source) #yield f"source const source_{source_name} = {{" yield f"// {source_name}" yield f".{field_name} = {{" yield f".{c_type}_array = array_{array_name}," yield f".count = {source.technique_common.accessor.count}," + yield f".stride = {source.technique_common.accessor.stride}," yield "}," def render_sampler(state, collada, sampler): @@ -549,13 +535,32 @@ def render_sampler(state, collada, sampler): enumerate(["INPUT", "OUTPUT", "IN_TANGENT", "OUT_TANGENT", "INTERPOLATION"])) inputs = sorted((input for input in sampler.inputs if input.semantic in order), key=lambda input: order[input.semantic]) + inputs_semantics = [input.semantic for input in inputs] + assert len(inputs_semantics) == len(set(inputs_semantics)) + assert "INPUT" in inputs_semantics + assert "OUTPUT" in inputs_semantics + assert "INTERPOLATION" in inputs_semantics + + # sampler validation + counts = set() + for input in inputs: + source = collada.lookup(input.source, types.SourceCore) + if input.semantic == "INTERPOLATION": + nonlinear_interpolation_params = [e for e in source.array_element.names if e != "LINEAR"] + if nonlinear_interpolation_params: + assert "IN_TANGENT" in inputs_semantics + assert "OUT_TANGENT" in inputs_semantics + counts.add(source.technique_common.accessor.count) + assert len(counts) == 1 # render the source arrays first for input in inputs: assert type(input) is types.InputUnshared source = collada.lookup(input.source, types.SourceCore) + yield from render_array(state, collada, source.technique_common.accessor, source.array_element) + # render the sampler sampler_name = sanitize_name(state, sampler.id, sampler) yield f"sampler const sampler_{sampler_name} = {{" for input in inputs: @@ -565,7 +570,7 @@ def render_sampler(state, collada, sampler): yield "};" target_attributes = { - "A", "ANGLE", "B", "G", "P", "Q", "R", "S", "T", "TIME", "U", "V", "W", "X", "Y", "Z" + "A", "ANGLE", "B", "G", "P", "Q", "R", "S", "T", "TIME", "U", "V", "W", "X", "Y", "Z", "ALL" } def find_transform_index_in_node(node, transform): @@ -588,11 +593,14 @@ def render_channel(state, collada, channel): sampler_name = sanitize_name(state, sampler.id, sampler) assert '/' in channel.target, channel.target - assert '.' in channel.target, channel.target assert "(" not in channel.target, channel.target node_id, rest = channel.target.split("/") - node_transform_sid, target_attribute = rest.split(".") + if '.' in rest: + node_transform_sid, target_attribute = rest.split(".") + else: + node_transform_sid = rest + target_attribute = 'ALL' assert target_attribute in target_attributes node = collada.lookup(f"#{node_id}", types.Node) @@ -659,10 +667,20 @@ def render_all(collada, namespace): # root elements render(render_library_visual_scenes(state, collada)) render(render_input_elements_list(state)) - render(render_descriptor()) + render(render_descriptor(namespace)) render(render_end_of_namespace()) return state, out +def render_hpp(namespace): + yield f"namespace {namespace} {{" + yield "extern collada::descriptor const descriptor;" + yield "}" + +def render_all_hpp(namespace): + render, out = renderer() + render(render_hpp(namespace)) + return out + if __name__ == "__main__": import sys collada = parse.parse_collada_file(sys.argv[1]) diff --git a/collada/main.py b/collada/main.py index fd95b5e..058c46e 100644 --- a/collada/main.py +++ b/collada/main.py @@ -7,15 +7,16 @@ from collada import header def usage(): name = sys.argv[0] print("usage:") - print(f" {name} [input_collada.dae] [output_header.hpp] [output_vertex.vtx] [output_vertex.idx]") + print(f" {name} [input_collada.dae] [output_source.cpp] [output_header.hpp] [output_vertex.vtx] [output_vertex.idx]") sys.exit(1) def main(): try: input_collada = sys.argv[1] - output_header = sys.argv[2] - output_vertex = sys.argv[3] - output_index = sys.argv[4] + output_source = sys.argv[2] + output_header = sys.argv[3] + output_vertex = sys.argv[4] + output_index = sys.argv[5] assert input_collada.lower().endswith(".dae") assert output_header.lower().endswith(".hpp") assert output_vertex.lower().endswith(".vtx") @@ -25,10 +26,16 @@ def main(): collada = parse.parse_collada_file(input_collada) namespace = path.splitext(path.split(input_collada)[1])[0] - state, out = header.render_all(collada, namespace) + state, out_source = header.render_all(collada, namespace) + out_header = header.render_all_hpp(namespace) + + with open(output_source, 'wb') as f: + source_buf = out_source.getvalue() + assert "\r\n" in source_buf + f.write(source_buf.encode('utf-8')) with open(output_header, 'wb') as f: - header_buf = out.getvalue() + header_buf = out_header.getvalue() assert "\r\n" in header_buf f.write(header_buf.encode('utf-8')) diff --git a/include/collada_scene.hpp b/include/collada_scene.hpp index b3e46c2..b3b4b75 100644 --- a/include/collada_scene.hpp +++ b/include/collada_scene.hpp @@ -15,9 +15,7 @@ namespace collada_scene { union { lookat lookat; XMMATRIX matrix; - XMVECTOR rotate; - XMVECTOR scale; - XMVECTOR translate; + XMVECTOR vector; }; collada::transform_type type; }; diff --git a/include/collada_types.hpp b/include/collada_types.hpp index 071078d..ee8cf9d 100644 --- a/include/collada_types.hpp +++ b/include/collada_types.hpp @@ -220,12 +220,10 @@ namespace collada { struct source { union { float const * const float_array; - float2 const * const float2_array; - float3 const * const float3_array; - float4 const * const float4_array; enum interpolation const * const interpolation_array; }; int const count; + int const stride; }; struct sampler { @@ -253,6 +251,7 @@ namespace collada { X, // first cartesian coordinate Y, // second cartesian coordinate Z, // third cartesian coordinate + ALL, }; struct channel { diff --git a/include/scenes/curve_interpolation.hpp b/include/scenes/curve_interpolation.hpp index d4bae77..dc8f7aa 100644 --- a/include/scenes/curve_interpolation.hpp +++ b/include/scenes/curve_interpolation.hpp @@ -1,700 +1,3 @@ -#include "collada_types.hpp" - namespace curve_interpolation { - -using namespace collada; - -float const array_node_cube_translation_x_input_array[] = { - 0.0f, - 1.666667f, - 3.333333f, - 5.0f, -}; - -float const array_node_cube_translation_x_output_array[] = { - 10.0f, - -10.0f, - 10.0f, - -10.0f, -}; - -float2 const array_node_cube_translation_x_intangent_array[] = { - { -0.3332306f, 10.0f }, - { 1.111167f, -10.0f }, - { 2.778333f, 10.0f }, - { 4.4445f, -9.219337f }, -}; - -float2 const array_node_cube_translation_x_outtangent_array[] = { - { 0.5555f, 10.0f }, - { 2.222167f, -10.0f }, - { 3.888333f, 10.0f }, - { 4.000208f, -8.594958f }, -}; - -enum interpolation const array_node_cube_translation_x_interpolation_array[] = { - interpolation::BEZIER, - interpolation::BEZIER, - interpolation::BEZIER, - interpolation::BEZIER, -}; - -sampler const sampler_node_cube_translation_x_sampler = { - // node_cube_translation_x_input - .input = { - .float_array = array_node_cube_translation_x_input_array, - .count = 4, - }, - // node_cube_translation_x_output - .output = { - .float_array = array_node_cube_translation_x_output_array, - .count = 4, - }, - // node_cube_translation_x_intangent - .in_tangent = { - .float2_array = array_node_cube_translation_x_intangent_array, - .count = 4, - }, - // node_cube_translation_x_outtangent - .out_tangent = { - .float2_array = array_node_cube_translation_x_outtangent_array, - .count = 4, - }, - // node_cube_translation_x_interpolation - .interpolation = { - .interpolation_array = array_node_cube_translation_x_interpolation_array, - .count = 4, - }, -}; - -float const array_node_cube_translation_y_input_array[] = { - -0.8333334f, - 0.8333334f, - 2.5f, - 4.166667f, -}; - -float const array_node_cube_translation_y_output_array[] = { - -10.05776f, - 10.05852f, - -9.941484f, - 10.05852f, -}; - -float2 const array_node_cube_translation_y_intangent_array[] = { - { -1.166264f, -10.05776f }, - { 0.2778334f, 10.05852f }, - { 1.9445f, -9.941484f }, - { 3.611667f, 10.05852f }, -}; - -float2 const array_node_cube_translation_y_outtangent_array[] = { - { -0.2783333f, -10.05776f }, - { 1.388833f, 10.05852f }, - { 3.0555f, -9.941484f }, - { 4.499598f, 10.05852f }, -}; - -enum interpolation const array_node_cube_translation_y_interpolation_array[] = { - interpolation::BEZIER, - interpolation::BEZIER, - interpolation::BEZIER, - interpolation::BEZIER, -}; - -sampler const sampler_node_cube_translation_y_sampler = { - // node_cube_translation_y_input - .input = { - .float_array = array_node_cube_translation_y_input_array, - .count = 4, - }, - // node_cube_translation_y_output - .output = { - .float_array = array_node_cube_translation_y_output_array, - .count = 4, - }, - // node_cube_translation_y_intangent - .in_tangent = { - .float2_array = array_node_cube_translation_y_intangent_array, - .count = 4, - }, - // node_cube_translation_y_outtangent - .out_tangent = { - .float2_array = array_node_cube_translation_y_outtangent_array, - .count = 4, - }, - // node_cube_translation_y_interpolation - .interpolation = { - .interpolation_array = array_node_cube_translation_y_interpolation_array, - .count = 4, - }, -}; - -channel const node_channel_node_cube_translation_x = { - .source_sampler = &sampler_node_cube_translation_x_sampler, - .target_transform_index = 0, - .target_attribute = target_attribute::X, -}; - -channel const node_channel_node_cube_translation_y = { - .source_sampler = &sampler_node_cube_translation_y_sampler, - .target_transform_index = 0, - .target_attribute = target_attribute::Y, -}; - -effect const effect_material__15 = { - .type = effect_type::BLINN, - .blinn = { - .emission = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .ambient = { - .color = {0.6705883f, 0.5843138f, 1.0f, 1.0f}, - }, - .diffuse = { - .color = {0.6705883f, 0.5843138f, 1.0f, 1.0f}, - }, - .specular = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .shininess = 10.0f, - .reflective = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .reflectivity = 0.0f, - .transparent = { - .color = {1.0f, 1.0f, 1.0f, 1.0f}, - }, - .transparency = 1.0f, - .index_of_refraction = 0.0f, - } -}; - -effect const effect_material__16 = { - .type = effect_type::BLINN, - .blinn = { - .emission = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .ambient = { - .color = {0.5803922f, 1.0f, 0.9647059f, 1.0f}, - }, - .diffuse = { - .color = {0.5803922f, 1.0f, 0.9647059f, 1.0f}, - }, - .specular = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .shininess = 10.0f, - .reflective = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .reflectivity = 0.0f, - .transparent = { - .color = {1.0f, 1.0f, 1.0f, 1.0f}, - }, - .transparency = 1.0f, - .index_of_refraction = 0.0f, - } -}; - -effect const effect_material__17 = { - .type = effect_type::BLINN, - .blinn = { - .emission = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .ambient = { - .color = {0.6509804f, 1.0f, 0.5803922f, 1.0f}, - }, - .diffuse = { - .color = {0.6509804f, 1.0f, 0.5803922f, 1.0f}, - }, - .specular = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .shininess = 10.0f, - .reflective = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .reflectivity = 0.0f, - .transparent = { - .color = {1.0f, 1.0f, 1.0f, 1.0f}, - }, - .transparency = 1.0f, - .index_of_refraction = 0.0f, - } -}; - -effect const effect_material__18 = { - .type = effect_type::BLINN, - .blinn = { - .emission = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .ambient = { - .color = {0.9333334f, 1.0f, 0.5647059f, 1.0f}, - }, - .diffuse = { - .color = {0.9333334f, 1.0f, 0.5647059f, 1.0f}, - }, - .specular = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .shininess = 10.0f, - .reflective = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .reflectivity = 0.0f, - .transparent = { - .color = {1.0f, 1.0f, 1.0f, 1.0f}, - }, - .transparency = 1.0f, - .index_of_refraction = 0.0f, - } -}; - -effect const effect_material__19 = { - .type = effect_type::BLINN, - .blinn = { - .emission = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .ambient = { - .color = {1.0f, 0.7686275f, 0.5803922f, 1.0f}, - }, - .diffuse = { - .color = {1.0f, 0.7686275f, 0.5803922f, 1.0f}, - }, - .specular = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .shininess = 10.0f, - .reflective = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .reflectivity = 0.0f, - .transparent = { - .color = {1.0f, 1.0f, 1.0f, 1.0f}, - }, - .transparency = 1.0f, - .index_of_refraction = 0.0f, - } -}; - -effect const effect_material__20 = { - .type = effect_type::BLINN, - .blinn = { - .emission = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .ambient = { - .color = {1.0f, 0.5803922f, 0.5803922f, 1.0f}, - }, - .diffuse = { - .color = {1.0f, 0.5803922f, 0.5803922f, 1.0f}, - }, - .specular = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .shininess = 10.0f, - .reflective = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .reflectivity = 0.0f, - .transparent = { - .color = {1.0f, 1.0f, 1.0f, 1.0f}, - }, - .transparency = 1.0f, - .index_of_refraction = 0.0f, - } -}; - -effect const effect_coloreffectr229g154b215 = { - .type = effect_type::PHONG, - .phong = { - .emission = { - .color = {0.0f, 0.0f, 0.0f, 0.0f}, - }, - .ambient = { - .color = {0.8980392f, 0.6039216f, 0.8431373f, 1.0f}, - }, - .diffuse = { - .color = {0.8980392f, 0.6039216f, 0.8431373f, 1.0f}, - }, - .specular = { - .color = {1.0f, 1.0f, 1.0f, 1.0f}, - }, - .shininess = 10.0f, - .reflective = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .reflectivity = 0.0f, - .transparent = { - .color = {1.0f, 1.0f, 1.0f, 1.0f}, - }, - .transparency = 1.0f, - .index_of_refraction = 0.0f, - } -}; - -effect const effect_coloreffectr28g149b177 = { - .type = effect_type::PHONG, - .phong = { - .emission = { - .color = {0.0f, 0.0f, 0.0f, 0.0f}, - }, - .ambient = { - .color = {0.1098039f, 0.5843137f, 0.6941176f, 1.0f}, - }, - .diffuse = { - .color = {0.1098039f, 0.5843137f, 0.6941176f, 1.0f}, - }, - .specular = { - .color = {1.0f, 1.0f, 1.0f, 1.0f}, - }, - .shininess = 10.0f, - .reflective = { - .color = {0.0f, 0.0f, 0.0f, 1.0f}, - }, - .reflectivity = 0.0f, - .transparent = { - .color = {1.0f, 1.0f, 1.0f, 1.0f}, - }, - .transparency = 1.0f, - .index_of_refraction = 0.0f, - } -}; - -material const material_coloreffectr229g154b215_material = { - .effect = &effect_coloreffectr229g154b215, -}; - -material const material_coloreffectr28g149b177_material = { - .effect = &effect_coloreffectr28g149b177, -}; - -material const material_material__15_material = { - .effect = &effect_material__15, -}; - -material const material_material__16_material = { - .effect = &effect_material__16, -}; - -material const material_material__17_material = { - .effect = &effect_material__17, -}; - -material const material_material__18_material = { - .effect = &effect_material__18, -}; - -material const material_material__19_material = { - .effect = &effect_material__19, -}; - -material const material_material__20_material = { - .effect = &effect_material__20, -}; - -input_element const input_elements_position_0_3_normal_0_3_texcoord_0_3[] = { - { - .semantic = "POSITION", - .semantic_index = 0, - .format = input_format::FLOAT3, - }, - { - .semantic = "NORMAL", - .semantic_index = 0, - .format = input_format::FLOAT3, - }, - { - .semantic = "TEXCOORD", - .semantic_index = 0, - .format = input_format::FLOAT3, - }, -}; - -triangles const triangles_geom_cube[] = { - { - .count = 2, // triangles - .index_offset = 0, // indices - .inputs_index = 0, // index into inputs_list - }, - { - .count = 2, // triangles - .index_offset = 6, // indices - .inputs_index = 0, // index into inputs_list - }, - { - .count = 2, // triangles - .index_offset = 12, // indices - .inputs_index = 0, // index into inputs_list - }, - { - .count = 2, // triangles - .index_offset = 18, // indices - .inputs_index = 0, // index into inputs_list - }, - { - .count = 2, // triangles - .index_offset = 24, // indices - .inputs_index = 0, // index into inputs_list - }, - { - .count = 2, // triangles - .index_offset = 30, // indices - .inputs_index = 0, // index into inputs_list - }, -}; - -geometry const geometry_geom_cube = { - .mesh = { - .triangles = triangles_geom_cube, - .triangles_count = 6, - - .vertex_buffer_offset = 0, - .vertex_buffer_size = 864, - - .index_buffer_offset = 0, - .index_buffer_size = 144, - } -}; - -triangles const triangles_geom_cylinder001[] = { - { - .count = 30, // triangles - .index_offset = 0, // indices - .inputs_index = 0, // index into inputs_list - }, -}; - -geometry const geometry_geom_cylinder001 = { - .mesh = { - .triangles = triangles_geom_cylinder001, - .triangles_count = 1, - - .vertex_buffer_offset = 864, - .vertex_buffer_size = 1152, - - .index_buffer_offset = 144, - .index_buffer_size = 360, - } -}; - -triangles const triangles_geom_plane001[] = { - { - .count = 2, // triangles - .index_offset = 0, // indices - .inputs_index = 0, // index into inputs_list - }, -}; - -geometry const geometry_geom_plane001 = { - .mesh = { - .triangles = triangles_geom_plane001, - .triangles_count = 1, - - .vertex_buffer_offset = 2016, - .vertex_buffer_size = 144, - - .index_buffer_offset = 504, - .index_buffer_size = 24, - } -}; - -geometry const * const geometries[] = { - &geometry_geom_cube, - &geometry_geom_cylinder001, - &geometry_geom_plane001, -}; - -transform const transforms_node_environmentambientlight[] = { -}; - -instance_geometry const instance_geometries_node_environmentambientlight[] = { -}; - -channel const * const node_channels_node_environmentambientlight[] = {}; - -node const node_node_environmentambientlight = { - .parent_index = -1, - - .type = node_type::NODE, - - .transforms = transforms_node_environmentambientlight, - .transforms_count = 0, - - .instance_geometries = instance_geometries_node_environmentambientlight, - .instance_geometries_count = 0, - - .channels = node_channels_node_environmentambientlight, - .channels_count = 0, -}; - -transform const transforms_node_cube[] = { - { - .type = transform_type::TRANSLATE, - .translate = {10.0f, -1.14258e-07f, 0.0f}, - }, -}; - -instance_material const instance_materials_node_cube_0[] = { - { - .element_index = 1, // an index into mesh.triangles - .material = &material_material__15_material, - }, - { - .element_index = 0, // an index into mesh.triangles - .material = &material_material__16_material, - }, - { - .element_index = 5, // an index into mesh.triangles - .material = &material_material__17_material, - }, - { - .element_index = 3, // an index into mesh.triangles - .material = &material_material__18_material, - }, - { - .element_index = 2, // an index into mesh.triangles - .material = &material_material__19_material, - }, - { - .element_index = 4, // an index into mesh.triangles - .material = &material_material__20_material, - }, -}; - -instance_geometry const instance_geometries_node_cube[] = { - { - .geometry = &geometry_geom_cube, - .instance_materials = instance_materials_node_cube_0, - .instance_materials_count = 6, - }, -}; - -channel const * const node_channels_node_cube[] = { - &node_channel_node_cube_translation_y, - &node_channel_node_cube_translation_x, -}; - -node const node_node_cube = { - .parent_index = -1, - - .type = node_type::NODE, - - .transforms = transforms_node_cube, - .transforms_count = 1, - - .instance_geometries = instance_geometries_node_cube, - .instance_geometries_count = 1, - - .channels = node_channels_node_cube, - .channels_count = 2, -}; - -transform const transforms_node_cylinder001[] = { -}; - -instance_material const instance_materials_node_cylinder001_0[] = { - { - .element_index = 0, // an index into mesh.triangles - .material = &material_coloreffectr229g154b215_material, - }, -}; - -instance_geometry const instance_geometries_node_cylinder001[] = { - { - .geometry = &geometry_geom_cylinder001, - .instance_materials = instance_materials_node_cylinder001_0, - .instance_materials_count = 1, - }, -}; - -channel const * const node_channels_node_cylinder001[] = { -}; - -node const node_node_cylinder001 = { - .parent_index = -1, - - .type = node_type::NODE, - - .transforms = transforms_node_cylinder001, - .transforms_count = 0, - - .instance_geometries = instance_geometries_node_cylinder001, - .instance_geometries_count = 1, - - .channels = node_channels_node_cylinder001, - .channels_count = 0, -}; - -transform const transforms_node_plane001[] = { - { - .type = transform_type::TRANSLATE, - .translate = {0.0f, 0.0f, 0.01f}, - }, - { - .type = transform_type::ROTATE, - .rotate = {0.0f, 0.0f, -1.0f, -44.99999f}, - }, -}; - -instance_material const instance_materials_node_plane001_0[] = { - { - .element_index = 0, // an index into mesh.triangles - .material = &material_coloreffectr28g149b177_material, - }, -}; - -instance_geometry const instance_geometries_node_plane001[] = { - { - .geometry = &geometry_geom_plane001, - .instance_materials = instance_materials_node_plane001_0, - .instance_materials_count = 1, - }, -}; - -channel const * const node_channels_node_plane001[] = { -}; - -node const node_node_plane001 = { - .parent_index = -1, - - .type = node_type::NODE, - - .transforms = transforms_node_plane001, - .transforms_count = 2, - - .instance_geometries = instance_geometries_node_plane001, - .instance_geometries_count = 1, - - .channels = node_channels_node_plane001, - .channels_count = 0, -}; - -node const * const nodes[] = { - &node_node_environmentambientlight, - &node_node_cube, - &node_node_cylinder001, - &node_node_plane001, -}; - -inputs const inputs_list[] = { - { - .elements = input_elements_position_0_3_normal_0_3_texcoord_0_3, - .elements_count = 3, - }, -}; - -descriptor const descriptor = { - .nodes = nodes, - .nodes_count = (sizeof (nodes)) / (sizeof (nodes[0])), - - .inputs_list = inputs_list, - .inputs_list_count = (sizeof (inputs_list)) / (sizeof (inputs_list[0])), -}; - +extern collada::descriptor const descriptor; } diff --git a/models/curve_interpolation/curve_interpolation.DAE b/models/curve_interpolation/curve_interpolation.DAE index 64889c2..446f27d 100755 --- a/models/curve_interpolation/curve_interpolation.DAE +++ b/models/curve_interpolation/curve_interpolation.DAE @@ -6,8 +6,8 @@ OpenCOLLADA for 3ds Max; Version: 1.6; Revision: 68 file:///C:/cygwin/home/bilbo/d3d10/models/curve_interpolation/curve_interpolation.max - 2026-01-26T20:45:12 - 2026-01-26T20:45:12 + 2026-01-27T22:01:59 + 2026-01-27T22:01:59 Z_UP @@ -348,6 +348,35 @@ + + + + + + 0.1019608 0.6941176 0.1019608 1 + + + 0.1019608 0.6941176 0.1019608 1 + + + 1 1 1 1 + + + 10 + + + 0 0 0 1 + + + 1 1 1 1 + + + 1 + + + + + @@ -406,14 +435,49 @@ + + + + + + 0.7764706 0.8784314 0.3411765 1 + + + 0.7764706 0.8784314 0.3411765 1 + + + 1 1 1 1 + + + 10 + + + 0 0 0 1 + + + 1 1 1 1 + + + 1 + + + + + + + + + + + @@ -507,6 +571,66 @@ + + + + -1.09278e-7 2.5 0 -1.0635e-7 2.433013 0.25 -9.83506e-8 2.25 0.4330127 -8.74228e-8 2 0.5 -7.64949e-8 1.75 0.4330127 -6.84952e-8 1.566987 0.25 -6.55671e-8 1.5 7.54979e-8 -6.84952e-8 1.566987 -0.2499999 -7.64949e-8 1.75 -0.4330126 -8.74228e-8 2 -0.5 -9.83506e-8 2.25 -0.4330128 -1.0635e-7 2.433012 -0.2500003 1.469463 2.022542 0 1.430089 1.968349 0.25 1.322517 1.820288 0.4330127 1.17557 1.618034 0.5 1.028624 1.41578 0.4330127 0.921052 1.267719 0.25 0.8816779 1.213526 7.54979e-8 0.921052 1.267719 -0.2499999 1.028624 1.41578 -0.4330126 1.17557 1.618034 -0.5 1.322517 1.820288 -0.4330128 1.430089 1.968349 -0.2500003 2.377641 0.7725425 0 2.313933 0.7518423 0.25 2.139877 0.6952882 0.4330127 1.902113 0.618034 0.5 1.664349 0.5407798 0.4330127 1.490294 0.4842257 0.25 1.426585 0.4635255 7.54979e-8 1.490294 0.4842257 -0.2499999 1.664349 0.5407797 -0.4330126 1.902113 0.6180339 -0.5 2.139877 0.6952882 -0.4330128 2.313932 0.7518422 -0.2500003 2.377641 -0.7725425 0 2.313933 -0.7518423 0.25 2.139877 -0.6952882 0.4330127 1.902113 -0.618034 0.5 1.664349 -0.5407798 0.4330127 1.490294 -0.4842257 0.25 1.426585 -0.4635255 7.54979e-8 1.490294 -0.4842257 -0.2499999 1.664349 -0.5407797 -0.4330126 1.902113 -0.6180339 -0.5 2.139877 -0.6952882 -0.4330128 2.313932 -0.7518422 -0.2500003 1.469463 -2.022542 0 1.430089 -1.968349 0.25 1.322517 -1.820288 0.4330127 1.17557 -1.618034 0.5 1.028624 -1.41578 0.4330127 0.921052 -1.267719 0.25 0.8816779 -1.213526 7.54979e-8 0.921052 -1.267719 -0.2499999 1.028624 -1.41578 -0.4330126 1.17557 -1.618034 -0.5 1.322517 -1.820288 -0.4330128 1.430089 -1.968349 -0.2500003 -1.09278e-7 -2.5 0 -1.0635e-7 -2.433013 0.25 -9.83506e-8 -2.25 0.4330127 -8.74228e-8 -2 0.5 -7.64949e-8 -1.75 0.4330127 -6.84952e-8 -1.566987 0.25 -6.55671e-8 -1.5 7.54979e-8 -6.84952e-8 -1.566987 -0.2499999 -7.64949e-8 -1.75 -0.4330126 -8.74228e-8 -2 -0.5 -9.83506e-8 -2.25 -0.4330128 -1.0635e-7 -2.433012 -0.2500003 -1.469463 -2.022542 0 -1.430089 -1.968349 0.25 -1.322517 -1.820288 0.4330127 -1.17557 -1.618034 0.5 -1.028624 -1.41578 0.4330127 -0.9210519 -1.267719 0.25 -0.8816777 -1.213526 7.54979e-8 -0.9210519 -1.267719 -0.2499999 -1.028624 -1.41578 -0.4330126 -1.17557 -1.618034 -0.5 -1.322517 -1.820288 -0.4330128 -1.430089 -1.968349 -0.2500003 -2.377641 -0.7725426 0 -2.313932 -0.7518424 0.25 -2.139877 -0.6952883 0.4330127 -1.902113 -0.6180341 0.5 -1.664349 -0.5407798 0.4330127 -1.490293 -0.4842257 0.25 -1.426585 -0.4635255 7.54979e-8 -1.490293 -0.4842257 -0.2499999 -1.664349 -0.5407798 -0.4330126 -1.902113 -0.618034 -0.5 -2.139877 -0.6952882 -0.4330128 -2.313932 -0.7518423 -0.2500003 -2.377641 0.7725424 0 -2.313933 0.7518422 0.25 -2.139877 0.6952882 0.4330127 -1.902113 0.6180339 0.5 -1.664349 0.5407797 0.4330127 -1.490294 0.4842257 0.25 -1.426585 0.4635255 7.54979e-8 -1.490294 0.4842257 -0.2499999 -1.664349 0.5407797 -0.4330126 -1.902113 0.6180339 -0.5 -2.139877 0.6952881 -0.4330128 -2.313932 0.7518421 -0.2500003 -1.469464 2.022542 0 -1.430089 1.968348 0.25 -1.322517 1.820288 0.4330127 -1.175571 1.618034 0.5 -1.028625 1.415779 0.4330127 -0.9210523 1.267719 0.25 -0.8816781 1.213525 7.54979e-8 -0.9210523 1.267719 -0.2499999 -1.028624 1.415779 -0.4330126 -1.175571 1.618033 -0.5 -1.322517 1.820288 -0.4330128 -1.430089 1.968348 -0.2500003 + + + + + + + + + + -1.39645e-7 1 -2.71833e-7 0.5159397 0.71013 0.4790842 0.5877851 0.809017 -1.46424e-7 -1.12014e-7 0.8777689 0.4790842 0.3154685 0.4342053 0.8437685 -9.73266e-8 0.5367071 0.8437687 0.03035063 0.04177406 0.9986659 -1.35335e-8 0.05163556 0.9986659 -0.2699911 -0.3716109 0.8882624 4.84062e-8 -0.4593363 0.8882624 -0.5008137 -0.6893111 0.5234843 1.02225e-7 -0.8520353 0.5234844 -0.5877852 -0.809017 1.46912e-8 1.32221e-7 -0.9999999 4.89707e-9 -0.5008138 -0.6893111 -0.5234841 9.24895e-8 -0.8520354 -0.5234841 -0.2699913 -0.3716112 -0.8882623 5.80874e-8 -0.4593366 -0.8882622 0.03035033 0.04177367 -0.998666 -2.46063e-8 0.05163517 -0.998666 0.3154682 0.4342048 -0.8437689 -8.70817e-8 0.5367067 -0.8437688 0.5159394 0.7101299 -0.4790846 -1.22682e-7 0.8777687 -0.4790847 0.8348078 0.2712456 0.4790843 0.9510565 0.3090169 -2.65732e-7 0.5104388 0.1658516 0.8437687 0.04910826 0.01595625 0.998666 -0.4368547 -0.1419427 0.8882625 -0.8103337 -0.2632934 0.5234844 -0.9510565 -0.309017 -9.79413e-9 -0.8103338 -0.2632935 -0.5234841 -0.4368552 -0.1419429 -0.8882623 0.04910788 0.01595613 -0.998666 0.5104386 0.1658515 -0.8437688 0.8348075 0.2712454 -0.4790847 0.8348078 -0.2712456 0.4790842 0.9510565 -0.309017 -3.52501e-7 0.5104389 -0.1658516 0.8437686 0.04910832 -0.01595627 0.9986659 -0.4368547 0.1419427 0.8882625 -0.8103337 0.2632934 0.5234844 -0.9510565 0.309017 2.44853e-8 -0.8103338 0.2632934 -0.5234841 -0.4368552 0.1419429 -0.8882623 0.04910788 -0.01595613 -0.998666 0.5104385 -0.1658515 -0.8437688 0.8348076 -0.2712455 -0.4790847 0.5159396 -0.7101301 0.4790841 0.5877853 -0.809017 -2.11501e-7 0.3154684 -0.4342052 0.8437686 0.03035063 -0.04177404 0.998666 -0.2699911 0.3716109 0.8882624 -0.5008137 0.6893111 0.5234843 -0.5877852 0.809017 9.79413e-9 -0.5008138 0.6893111 -0.5234841 -0.2699913 0.3716112 -0.8882622 0.03035034 -0.04177368 -0.998666 0.3154682 -0.4342048 -0.8437689 0.5159395 -0.7101298 -0.4790846 -6.40082e-8 -0.8777689 0.4790843 -7.59233e-8 -1 -2.38616e-7 -2.3051e-8 -0.536707 0.8437687 2.46063e-9 -0.05163559 0.998666 2.90437e-8 0.4593363 0.8882624 1.46036e-8 0.8520353 0.5234843 9.79413e-9 0.9999999 2.93824e-8 3.40751e-8 0.8520354 -0.5234841 1.69422e-8 0.4593367 -0.8882622 -2.46063e-9 -0.05163516 -0.998666 -3.07347e-8 -0.5367067 -0.8437688 -3.73381e-8 -0.8777686 -0.4790848 -0.5159397 -0.7101299 0.4790842 -0.5877852 -0.8090169 -2.54885e-7 -0.3154685 -0.4342053 0.8437686 -0.03035061 -0.04177405 0.9986659 0.2699912 0.3716109 0.8882624 0.5008138 0.689311 0.5234843 0.5877852 0.8090171 2.93824e-8 0.5008138 0.6893111 -0.5234842 0.2699913 0.3716112 -0.8882622 -0.03035032 -0.04177361 -0.998666 -0.3154683 -0.4342048 -0.8437689 -0.5159395 -0.7101299 -0.4790846 -0.8348078 -0.2712456 0.4790843 -0.9510564 -0.309017 -3.03693e-7 -0.5104389 -0.1658517 0.8437685 -0.04910835 -0.01595627 0.998666 0.4368547 0.1419428 0.8882624 0.8103337 0.2632934 0.5234843 0.9510565 0.3090171 9.79413e-9 0.8103338 0.2632935 -0.5234842 0.4368551 0.1419429 -0.8882622 -0.04910791 -0.01595615 -0.9986661 -0.5104385 -0.1658516 -0.8437688 -0.8348075 -0.2712456 -0.4790848 -0.8348079 0.2712454 0.4790843 -0.9510565 0.3090169 -3.36232e-7 -0.5104389 0.1658516 0.8437685 -0.04910829 0.01595625 0.998666 0.4368548 -0.1419427 0.8882625 0.8103337 -0.2632933 0.5234843 0.9510565 -0.3090169 3.91765e-8 0.8103339 -0.2632934 -0.5234841 0.4368552 -0.1419428 -0.8882623 -0.04910788 0.01595612 -0.998666 -0.5104386 0.1658515 -0.8437688 -0.8348076 0.2712454 -0.4790848 -0.5159396 0.71013 0.4790843 -0.5877853 0.8090169 -2.71155e-7 -0.3154685 0.434205 0.8437687 -0.03035063 0.04177407 0.998666 0.2699911 -0.3716108 0.8882625 0.5008138 -0.6893109 0.5234844 0.5877853 -0.8090169 1.46912e-8 0.500814 -0.6893111 -0.5234841 0.2699914 -0.3716112 -0.8882623 -0.03035034 0.04177367 -0.998666 -0.3154683 0.4342048 -0.8437688 -0.5159395 0.7101298 -0.4790846 + + + + + + + + + + 0 0 0 0.08333334 0 0 0.1666667 0 0 0.25 0 0 0.3333333 0 0 0.4166667 0 0 0.5 0 0 0.5833333 0 0 0.6666667 0 0 0.75 0 0 0.8333333 0 0 0.9166667 0 0 1 0 0 0 0.1 0 0.08333334 0.1 0 0.1666667 0.1 0 0.25 0.1 0 0.3333333 0.1 0 0.4166667 0.1 0 0.5 0.1 0 0.5833333 0.1 0 0.6666667 0.1 0 0.75 0.1 0 0.8333333 0.1 0 0.9166667 0.1 0 1 0.1 0 0 0.2 0 0.08333334 0.2 0 0.1666667 0.2 0 0.25 0.2 0 0.3333333 0.2 0 0.4166667 0.2 0 0.5 0.2 0 0.5833333 0.2 0 0.6666667 0.2 0 0.75 0.2 0 0.8333333 0.2 0 0.9166667 0.2 0 1 0.2 0 0 0.3 0 0.08333334 0.3 0 0.1666667 0.3 0 0.25 0.3 0 0.3333333 0.3 0 0.4166667 0.3 0 0.5 0.3 0 0.5833333 0.3 0 0.6666667 0.3 0 0.75 0.3 0 0.8333333 0.3 0 0.9166667 0.3 0 1 0.3 0 0 0.4 0 0.08333334 0.4 0 0.1666667 0.4 0 0.25 0.4 0 0.3333333 0.4 0 0.4166667 0.4 0 0.5 0.4 0 0.5833333 0.4 0 0.6666667 0.4 0 0.75 0.4 0 0.8333333 0.4 0 0.9166667 0.4 0 1 0.4 0 0 0.5 0 0.08333334 0.5 0 0.1666667 0.5 0 0.25 0.5 0 0.3333333 0.5 0 0.4166667 0.5 0 0.5 0.5 0 0.5833333 0.5 0 0.6666667 0.5 0 0.75 0.5 0 0.8333333 0.5 0 0.9166667 0.5 0 1 0.5 0 0 0.6 0 0.08333334 0.6 0 0.1666667 0.6 0 0.25 0.6 0 0.3333333 0.6 0 0.4166667 0.6 0 0.5 0.6 0 0.5833333 0.6 0 0.6666667 0.6 0 0.75 0.6 0 0.8333333 0.6 0 0.9166667 0.6 0 1 0.6 0 0 0.7 0 0.08333334 0.7 0 0.1666667 0.7 0 0.25 0.7 0 0.3333333 0.7 0 0.4166667 0.7 0 0.5 0.7 0 0.5833333 0.7 0 0.6666667 0.7 0 0.75 0.7 0 0.8333333 0.7 0 0.9166667 0.7 0 1 0.7 0 0 0.8 0 0.08333334 0.8 0 0.1666667 0.8 0 0.25 0.8 0 0.3333333 0.8 0 0.4166667 0.8 0 0.5 0.8 0 0.5833333 0.8 0 0.6666667 0.8 0 0.75 0.8 0 0.8333333 0.8 0 0.9166667 0.8 0 1 0.8 0 0 0.9 0 0.08333334 0.9 0 0.1666667 0.9 0 0.25 0.9 0 0.3333333 0.9 0 0.4166667 0.9 0 0.5 0.9 0 0.5833333 0.9 0 0.6666667 0.9 0 0.75 0.9 0 0.8333333 0.9 0 0.9166667 0.9 0 1 0.9 0 0 1 0 0.08333334 1 0 0.1666667 1 0 0.25 1 0 0.3333333 1 0 0.4166667 1 0 0.5 1 0 0.5833333 1 0 0.6666667 1 0 0.75 1 0 0.8333333 1 0 0.9166667 1 0 1 1 0 + + + + + + + + + + + + + + + +

0 0 0 13 1 14 12 2 13 0 0 0 1 3 1 13 1 14 1 3 1 14 4 15 13 1 14 1 3 1 2 5 2 14 4 15 2 5 2 15 6 16 14 4 15 2 5 2 3 7 3 15 6 16 3 7 3 16 8 17 15 6 16 3 7 3 4 9 4 16 8 17 4 9 4 17 10 18 16 8 17 4 9 4 5 11 5 17 10 18 5 11 5 18 12 19 17 10 18 5 11 5 6 13 6 18 12 19 6 13 6 19 14 20 18 12 19 6 13 6 7 15 7 19 14 20 7 15 7 20 16 21 19 14 20 7 15 7 8 17 8 20 16 21 8 17 8 21 18 22 20 16 21 8 17 8 9 19 9 21 18 22 9 19 9 22 20 23 21 18 22 9 19 9 10 21 10 22 20 23 10 21 10 23 22 24 22 20 23 10 21 10 11 23 11 23 22 24 11 23 11 12 2 25 23 22 24 11 23 11 0 0 12 12 2 25 12 2 13 25 24 27 24 25 26 12 2 13 13 1 14 25 24 27 13 1 14 26 26 28 25 24 27 13 1 14 14 4 15 26 26 28 14 4 15 27 27 29 26 26 28 14 4 15 15 6 16 27 27 29 15 6 16 28 28 30 27 27 29 15 6 16 16 8 17 28 28 30 16 8 17 29 29 31 28 28 30 16 8 17 17 10 18 29 29 31 17 10 18 30 30 32 29 29 31 17 10 18 18 12 19 30 30 32 18 12 19 31 31 33 30 30 32 18 12 19 19 14 20 31 31 33 19 14 20 32 32 34 31 31 33 19 14 20 20 16 21 32 32 34 20 16 21 33 33 35 32 32 34 20 16 21 21 18 22 33 33 35 21 18 22 34 34 36 33 33 35 21 18 22 22 20 23 34 34 36 22 20 23 35 35 37 34 34 36 22 20 23 23 22 24 35 35 37 23 22 24 24 25 38 35 35 37 23 22 24 12 2 25 24 25 38 24 25 26 37 36 40 36 37 39 24 25 26 25 24 27 37 36 40 25 24 27 38 38 41 37 36 40 25 24 27 26 26 28 38 38 41 26 26 28 39 39 42 38 38 41 26 26 28 27 27 29 39 39 42 27 27 29 40 40 43 39 39 42 27 27 29 28 28 30 40 40 43 28 28 30 41 41 44 40 40 43 28 28 30 29 29 31 41 41 44 29 29 31 42 42 45 41 41 44 29 29 31 30 30 32 42 42 45 30 30 32 43 43 46 42 42 45 30 30 32 31 31 33 43 43 46 31 31 33 44 44 47 43 43 46 31 31 33 32 32 34 44 44 47 32 32 34 45 45 48 44 44 47 32 32 34 33 33 35 45 45 48 33 33 35 46 46 49 45 45 48 33 33 35 34 34 36 46 46 49 34 34 36 47 47 50 46 46 49 34 34 36 35 35 37 47 47 50 35 35 37 36 37 51 47 47 50 35 35 37 24 25 38 36 37 51 36 37 39 49 48 53 48 49 52 36 37 39 37 36 40 49 48 53 37 36 40 50 50 54 49 48 53 37 36 40 38 38 41 50 50 54 38 38 41 51 51 55 50 50 54 38 38 41 39 39 42 51 51 55 39 39 42 52 52 56 51 51 55 39 39 42 40 40 43 52 52 56 40 40 43 53 53 57 52 52 56 40 40 43 41 41 44 53 53 57 41 41 44 54 54 58 53 53 57 41 41 44 42 42 45 54 54 58 42 42 45 55 55 59 54 54 58 42 42 45 43 43 46 55 55 59 43 43 46 56 56 60 55 55 59 43 43 46 44 44 47 56 56 60 44 44 47 57 57 61 56 56 60 44 44 47 45 45 48 57 57 61 45 45 48 58 58 62 57 57 61 45 45 48 46 46 49 58 58 62 46 46 49 59 59 63 58 58 62 46 46 49 47 47 50 59 59 63 47 47 50 48 49 64 59 59 63 47 47 50 36 37 51 48 49 64 48 49 52 61 60 66 60 61 65 48 49 52 49 48 53 61 60 66 49 48 53 62 62 67 61 60 66 49 48 53 50 50 54 62 62 67 50 50 54 63 63 68 62 62 67 50 50 54 51 51 55 63 63 68 51 51 55 64 64 69 63 63 68 51 51 55 52 52 56 64 64 69 52 52 56 65 65 70 64 64 69 52 52 56 53 53 57 65 65 70 53 53 57 66 66 71 65 65 70 53 53 57 54 54 58 66 66 71 54 54 58 67 67 72 66 66 71 54 54 58 55 55 59 67 67 72 55 55 59 68 68 73 67 67 72 55 55 59 56 56 60 68 68 73 56 56 60 69 69 74 68 68 73 56 56 60 57 57 61 69 69 74 57 57 61 70 70 75 69 69 74 57 57 61 58 58 62 70 70 75 58 58 62 71 71 76 70 70 75 58 58 62 59 59 63 71 71 76 59 59 63 60 61 77 71 71 76 59 59 63 48 49 64 60 61 77 60 61 65 73 72 79 72 73 78 60 61 65 61 60 66 73 72 79 61 60 66 74 74 80 73 72 79 61 60 66 62 62 67 74 74 80 62 62 67 75 75 81 74 74 80 62 62 67 63 63 68 75 75 81 63 63 68 76 76 82 75 75 81 63 63 68 64 64 69 76 76 82 64 64 69 77 77 83 76 76 82 64 64 69 65 65 70 77 77 83 65 65 70 78 78 84 77 77 83 65 65 70 66 66 71 78 78 84 66 66 71 79 79 85 78 78 84 66 66 71 67 67 72 79 79 85 67 67 72 80 80 86 79 79 85 67 67 72 68 68 73 80 80 86 68 68 73 81 81 87 80 80 86 68 68 73 69 69 74 81 81 87 69 69 74 82 82 88 81 81 87 69 69 74 70 70 75 82 82 88 70 70 75 83 83 89 82 82 88 70 70 75 71 71 76 83 83 89 71 71 76 72 73 90 83 83 89 71 71 76 60 61 77 72 73 90 72 73 78 85 84 92 84 85 91 72 73 78 73 72 79 85 84 92 73 72 79 86 86 93 85 84 92 73 72 79 74 74 80 86 86 93 74 74 80 87 87 94 86 86 93 74 74 80 75 75 81 87 87 94 75 75 81 88 88 95 87 87 94 75 75 81 76 76 82 88 88 95 76 76 82 89 89 96 88 88 95 76 76 82 77 77 83 89 89 96 77 77 83 90 90 97 89 89 96 77 77 83 78 78 84 90 90 97 78 78 84 91 91 98 90 90 97 78 78 84 79 79 85 91 91 98 79 79 85 92 92 99 91 91 98 79 79 85 80 80 86 92 92 99 80 80 86 93 93 100 92 92 99 80 80 86 81 81 87 93 93 100 81 81 87 94 94 101 93 93 100 81 81 87 82 82 88 94 94 101 82 82 88 95 95 102 94 94 101 82 82 88 83 83 89 95 95 102 83 83 89 84 85 103 95 95 102 83 83 89 72 73 90 84 85 103 84 85 91 97 96 105 96 97 104 84 85 91 85 84 92 97 96 105 85 84 92 98 98 106 97 96 105 85 84 92 86 86 93 98 98 106 86 86 93 99 99 107 98 98 106 86 86 93 87 87 94 99 99 107 87 87 94 100 100 108 99 99 107 87 87 94 88 88 95 100 100 108 88 88 95 101 101 109 100 100 108 88 88 95 89 89 96 101 101 109 89 89 96 102 102 110 101 101 109 89 89 96 90 90 97 102 102 110 90 90 97 103 103 111 102 102 110 90 90 97 91 91 98 103 103 111 91 91 98 104 104 112 103 103 111 91 91 98 92 92 99 104 104 112 92 92 99 105 105 113 104 104 112 92 92 99 93 93 100 105 105 113 93 93 100 106 106 114 105 105 113 93 93 100 94 94 101 106 106 114 94 94 101 107 107 115 106 106 114 94 94 101 95 95 102 107 107 115 95 95 102 96 97 116 107 107 115 95 95 102 84 85 103 96 97 116 96 97 104 109 108 118 108 109 117 96 97 104 97 96 105 109 108 118 97 96 105 110 110 119 109 108 118 97 96 105 98 98 106 110 110 119 98 98 106 111 111 120 110 110 119 98 98 106 99 99 107 111 111 120 99 99 107 112 112 121 111 111 120 99 99 107 100 100 108 112 112 121 100 100 108 113 113 122 112 112 121 100 100 108 101 101 109 113 113 122 101 101 109 114 114 123 113 113 122 101 101 109 102 102 110 114 114 123 102 102 110 115 115 124 114 114 123 102 102 110 103 103 111 115 115 124 103 103 111 116 116 125 115 115 124 103 103 111 104 104 112 116 116 125 104 104 112 117 117 126 116 116 125 104 104 112 105 105 113 117 117 126 105 105 113 118 118 127 117 117 126 105 105 113 106 106 114 118 118 127 106 106 114 119 119 128 118 118 127 106 106 114 107 107 115 119 119 128 107 107 115 108 109 129 119 119 128 107 107 115 96 97 116 108 109 129 108 109 117 1 3 131 0 0 130 108 109 117 109 108 118 1 3 131 109 108 118 2 5 132 1 3 131 109 108 118 110 110 119 2 5 132 110 110 119 3 7 133 2 5 132 110 110 119 111 111 120 3 7 133 111 111 120 4 9 134 3 7 133 111 111 120 112 112 121 4 9 134 112 112 121 5 11 135 4 9 134 112 112 121 113 113 122 5 11 135 113 113 122 6 13 136 5 11 135 113 113 122 114 114 123 6 13 136 114 114 123 7 15 137 6 13 136 114 114 123 115 115 124 7 15 137 115 115 124 8 17 138 7 15 137 115 115 124 116 116 125 8 17 138 116 116 125 9 19 139 8 17 138 116 116 125 117 117 126 9 19 139 117 117 126 10 21 140 9 19 139 117 117 126 118 118 127 10 21 140 118 118 127 11 23 141 10 21 140 118 118 127 119 119 128 11 23 141 119 119 128 0 0 142 11 23 141 119 119 128 108 109 129 0 0 142

+
+
+ + + + 2 + 0.5 + 0 + 0 + 10 + 12 + 2 + 0 + 0 + 0 + 1 + + + +
@@ -606,6 +730,49 @@ + + + + 0 0 1.039281 0.929561 0 0.4647805 0.2872501 0.884065 0.4647805 -0.7520307 0.5463822 0.4647805 -0.7520306 -0.5463823 0.4647805 0.2872503 -0.884065 0.4647805 0.5463822 0 0.8840649 0.1688414 0.5196404 0.8840649 -0.4420325 0.3211554 0.8840649 -0.4420325 -0.3211555 0.8840649 0.1688415 -0.5196403 0.8840649 0.7152236 0.5196404 0.5463822 -0.2731912 0.8407957 0.5463822 -0.884065 -6.664e-8 0.5463822 -0.273191 -0.8407958 0.5463822 0.7152236 -0.5196403 0.5463822 0.9884146 0.3211554 0 -3.332e-8 1.039281 0 -0.9884147 0.3211553 0 -0.6108739 -0.8407958 0 0.6108741 -0.8407956 0 0.9884148 -0.3211552 0 0.6108739 0.8407957 0 -0.6108739 0.8407957 0 -0.9884146 -0.3211555 0 1.666e-8 -1.039281 0 + + + + + + + + + + 1.05124e-8 -2.6281e-9 1 0.5257311 1.32646e-8 0.8506508 0.1624598 0.5 0.8506508 0.8944272 5.25619e-8 0.4472137 0.6881909 0.5 0.5257311 0.2763931 0.8506508 0.4472136 -0.4253254 0.3090169 0.8506508 -0.2628656 0.8090169 0.5257311 -0.7236068 0.5257311 0.4472136 -0.4253254 -0.3090171 0.8506507 -0.8506508 -9.01996e-8 0.5257311 -0.7236068 -0.5257311 0.4472137 0.1624599 -0.5 0.8506508 -0.2628654 -0.8090169 0.5257312 0.2763933 -0.8506508 0.4472136 0.6881909 -0.4999999 0.5257311 0.9224887 -0.3159864 0.2217367 0.9224886 0.3159866 0.2217367 0.5855858 0.7796935 0.2217367 -0.01545645 0.9749841 0.2217368 -0.5605768 0.7978637 0.2217367 -0.9320413 0.2865866 0.2217367 -0.9320413 -0.2865868 0.2217367 -0.5605767 -0.7978638 0.2217368 -0.01545633 -0.9749841 0.2217368 0.585586 -0.7796935 0.2217367 + + + + + + + + + + 0.6 1 1.039281 0.5 0.8237918 1.039281 0.7 0.8237918 1.039281 0.5 0.8237918 1.039281 0.5 0.6475836 1.039281 0.6 0.6762082 1.039281 0.5 0.8237918 1.039281 0.6 0.6762082 1.039281 0.7 0.8237918 1.039281 0.7 0.8237918 1.039281 0.6 0.6762082 1.039281 0.7 0.6475836 1.039281 0.8 1 1.039281 0.7 0.8237918 1.039281 0.9 0.8237918 1.039281 0.7 0.8237918 1.039281 0.7 0.6475836 1.039281 0.8 0.6762082 1.039281 0.7 0.8237918 1.039281 0.8 0.6762082 1.039281 0.9 0.8237918 1.039281 0.9 0.8237918 1.039281 0.8 0.6762082 1.039281 0.9 0.6475836 1.039281 7.45058e-9 1 1.039281 -0.1 0.8237918 1.039281 0.1 0.8237918 1.039281 -0.1 0.8237918 1.039281 -0.1 0.6475836 1.039281 3.79455e-8 0.6762082 1.039281 -0.1 0.8237918 1.039281 3.79455e-8 0.6762082 1.039281 0.1 0.8237918 1.039281 0.1 0.8237918 1.039281 3.79455e-8 0.6762082 1.039281 0.1 0.6475836 1.039281 0.2 1 1.039281 0.1 0.8237918 1.039281 0.3 0.8237918 1.039281 0.1 0.8237918 1.039281 0.1 0.6475836 1.039281 0.2 0.6762082 1.039281 0.1 0.8237918 1.039281 0.2 0.6762082 1.039281 0.3 0.8237918 1.039281 0.3 0.8237918 1.039281 0.2 0.6762082 1.039281 0.3 0.6475836 1.039281 0.4 1 1.039281 0.3 0.8237918 1.039281 0.5 0.8237918 1.039281 0.3 0.8237918 1.039281 0.3 0.6475836 1.039281 0.4 0.6762082 1.039281 0.3 0.8237918 1.039281 0.4 0.6762082 1.039281 0.5 0.8237918 1.039281 0.5 0.8237918 1.039281 0.4 0.6762082 1.039281 0.5 0.6475836 1.039281 0.5 0.6475836 1.039281 0.45 0.5 1.039281 0.55 0.5 1.039281 0.7 0.6475836 1.039281 0.65 0.5 1.039281 0.75 0.5 1.039281 0.9 0.6475836 1.039281 0.85 0.5 1.039281 0.95 0.5 1.039281 0.1 0.6475836 1.039281 0.05000002 0.5 1.039281 0.15 0.5 1.039281 0.3 0.6475836 1.039281 0.25 0.5 1.039281 0.3500001 0.5 1.039281 0.65 0.5 1.039281 0.7 0.6475836 1.039281 0.6 0.6762082 1.039281 0.65 0.5 1.039281 0.6 0.6762082 1.039281 0.55 0.5 1.039281 0.55 0.5 1.039281 0.6 0.6762082 1.039281 0.5 0.6475836 1.039281 0.85 0.5 1.039281 0.9 0.6475836 1.039281 0.8 0.6762082 1.039281 0.85 0.5 1.039281 0.8 0.6762082 1.039281 0.75 0.5 1.039281 0.75 0.5 1.039281 0.8 0.6762082 1.039281 0.7 0.6475836 1.039281 0.05000002 0.5 1.039281 0.1 0.6475836 1.039281 3.79455e-8 0.6762082 1.039281 0.05000002 0.5 1.039281 3.79455e-8 0.6762082 1.039281 -0.05000001 0.5 1.039281 -0.05000001 0.5 1.039281 3.79455e-8 0.6762082 1.039281 -0.1 0.6475836 1.039281 0.25 0.5 1.039281 0.3 0.6475836 1.039281 0.2 0.6762082 1.039281 0.25 0.5 1.039281 0.2 0.6762082 1.039281 0.15 0.5 1.039281 0.15 0.5 1.039281 0.2 0.6762082 1.039281 0.1 0.6475836 1.039281 0.45 0.5 1.039281 0.5 0.6475836 1.039281 0.4 0.6762082 1.039281 0.45 0.5 1.039281 0.4 0.6762082 1.039281 0.3500001 0.5 1.039281 0.3500001 0.5 1.039281 0.4 0.6762082 1.039281 0.3 0.6475836 1.039281 + + + + + + + + + + + + + + + +

0 0 0 6 1 1 7 2 2 6 1 3 1 3 4 11 4 5 6 1 6 11 4 7 7 2 8 7 2 9 11 4 10 2 5 11 0 0 12 7 2 13 8 6 14 7 2 15 2 5 16 12 7 17 7 2 18 12 7 19 8 6 20 8 6 21 12 7 22 3 8 23 0 0 24 8 6 25 9 9 26 8 6 27 3 8 28 13 10 29 8 6 30 13 10 31 9 9 32 9 9 33 13 10 34 4 11 35 0 0 36 9 9 37 10 12 38 9 9 39 4 11 40 14 13 41 9 9 42 14 13 43 10 12 44 10 12 45 14 13 46 5 14 47 0 0 48 10 12 49 6 1 50 10 12 51 5 14 52 15 15 53 10 12 54 15 15 55 6 1 56 6 1 57 15 15 58 1 3 59 1 3 60 21 16 61 16 17 62 2 5 63 22 18 64 17 19 65 3 8 66 23 20 67 18 21 68 4 11 69 24 22 70 19 23 71 5 14 72 25 24 73 20 25 74 22 18 75 2 5 76 11 4 77 22 18 78 11 4 79 16 17 80 16 17 81 11 4 82 1 3 83 23 20 84 3 8 85 12 7 86 23 20 87 12 7 88 17 19 89 17 19 90 12 7 91 2 5 92 24 22 93 4 11 94 13 10 95 24 22 96 13 10 97 18 21 98 18 21 99 13 10 100 3 8 101 25 24 102 5 14 103 14 13 104 25 24 105 14 13 106 19 23 107 19 23 108 14 13 109 4 11 110 21 16 111 1 3 112 15 15 113 21 16 114 15 15 115 20 25 116 20 25 117 15 15 118 5 14 119

+
+
+
@@ -629,12 +796,34 @@ + - + + 5 1.14258e-7 2 + 0 0 1 0 + 0 1 0 2.00358e-5 + 1 0 0 0 + 0.5 0.5 0.5 + + + + + + + + + + 1 + 1 + 1 + 1 + + + 1 @@ -680,6 +869,27 @@ + + 0.03164387 -0.03838623 0 + 0 0 0 0 + 1 1 1 + 0 0 0 0 + + + + + + + + + + 1 + 1 + 1 + 1 + + + @@ -768,6 +978,154 @@ + + 0 0.8333334 1.666667 2.5 3.333333 + + + + + + + + 0 -90 -180 -270 -360 + + + + + + + + 0.9997917 0 0.3270486 -89.70257 0.9961964 -179.1937 1.990403 -269.8432 2.6534 -360 + + + + + + + + + 0.6602973 0 1.324714 -90.28867 2.332406 -180.8006 3.004865 -270.1553 2.333542 -360 + + + + + + + + + BEZIER BEZIER BEZIER BEZIER BEZIER + + + + + + + + 0 1.666667 3.333333 + + + + + + + + 1 1 1 1.996525 1.996525 1.996525 1 1 1 + + + + + + + + + + 0.9997917 1 0.9997917 1 0.9997917 1 1.111167 1.996525 1.111167 1.996525 1.111167 1.996525 2.777833 1 2.777833 1 2.777833 1 + + + + + + + + + + + + + 0.5555 1 0.5555 1 0.5555 1 2.222167 1.996525 2.222167 1.996525 2.222167 1.996525 2.333542 1 2.333542 1 2.333542 1 + + + + + + + + + + + + + BEZIER BEZIER BEZIER + + + + + + + + 0 1.666667 3.333333 + + + + + + + + 0 0 0 0 0 0 0 0 0 0 0 0 + + + + + + + + + + + LINEAR LINEAR LINEAR + + + + + + + + 0 1.666667 3.333333 + + + + + + + + 0 0 0 0 0 0 0 0 0 0 0 0 + + + + + + + + + + + LINEAR LINEAR LINEAR + + + + + + @@ -782,8 +1140,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/models/curve_interpolation/curve_interpolation.idx b/models/curve_interpolation/curve_interpolation.idx index f1f1a85..5de993b 100644 Binary files a/models/curve_interpolation/curve_interpolation.idx and b/models/curve_interpolation/curve_interpolation.idx differ diff --git a/models/curve_interpolation/curve_interpolation.max b/models/curve_interpolation/curve_interpolation.max index db1884c..a703be2 100755 Binary files a/models/curve_interpolation/curve_interpolation.max and b/models/curve_interpolation/curve_interpolation.max differ diff --git a/models/curve_interpolation/curve_interpolation.vtx b/models/curve_interpolation/curve_interpolation.vtx index 76208f7..5d54548 100644 Binary files a/models/curve_interpolation/curve_interpolation.vtx and b/models/curve_interpolation/curve_interpolation.vtx differ diff --git a/src/collada_scene.cpp b/src/collada_scene.cpp index a4b3a6b..41f5821 100644 --- a/src/collada_scene.cpp +++ b/src/collada_scene.cpp @@ -83,13 +83,13 @@ namespace collada_scene { transform.matrix = XMLoadFloat4x4((XMFLOAT4X4 *)&node->transforms[i].matrix); break; case transform_type::ROTATE: - transform.rotate = XMLoadFloat4((XMFLOAT4 *)&node->transforms[i].rotate); + transform.vector = XMLoadFloat4((XMFLOAT4 *)&node->transforms[i].rotate); break; case transform_type::SCALE: - transform.scale = XMLoadFloat3((XMFLOAT3 *)&node->transforms[i].scale); + transform.vector = XMLoadFloat3((XMFLOAT3*)&node->transforms[i].scale); break; case transform_type::TRANSLATE: - transform.translate = XMLoadFloat3((XMFLOAT3*)&node->transforms[i].translate); + transform.vector = XMLoadFloat3((XMFLOAT3*)&node->transforms[i].translate); break; default: assert(false); @@ -271,12 +271,12 @@ namespace collada_scene { { switch (transform.type) { case transform_type::TRANSLATE: - return XMMatrixTranslationFromVector(transform.translate); + return XMMatrixTranslationFromVector(transform.vector); case transform_type::ROTATE: - return XMMatrixRotationNormal(transform.rotate, - XMConvertToRadians(XMVectorGetW(transform.rotate))); + return XMMatrixRotationNormal(transform.vector, + XMConvertToRadians(XMVectorGetW(transform.vector))); case transform_type::SCALE: - return XMMatrixScalingFromVector(transform.scale); + return XMMatrixScalingFromVector(transform.vector); default: assert(false); break; @@ -360,17 +360,17 @@ namespace collada_scene { return -1; } - static inline float interpolation_value(source const& source, int ix, float t) + static inline float linear_interpolate_iv(source const& source, int frame_ix, float t) { - float prev = source.float_array[ix]; - float next = source.float_array[ix+1]; + float prev = source.float_array[(frame_ix+0) * source.stride]; + float next = source.float_array[(frame_ix+1) * source.stride]; return (t - prev) / (next - prev); } - static inline float linear_interpolate(source const& source, int ix, float iv) + static inline float linear_interpolate_value(source const& source, int frame_ix, int parameter_ix, float iv) { - float prev = source.float_array[ix]; - float next = source.float_array[ix+1]; + float prev = source.float_array[(frame_ix+0) * source.stride + parameter_ix]; + float next = source.float_array[(frame_ix+1) * source.stride + parameter_ix]; return prev + iv * (next - prev); } @@ -425,7 +425,13 @@ namespace collada_scene { assert(false); } - static float bezier_sampler(sampler const * const sampler, int ix, float t) + static inline XMFLOAT2 const * tangent_index(source const& source, int frame_ix, int parameter_ix) + { + int ix = frame_ix * source.stride + parameter_ix * 2; + return (XMFLOAT2 const *)&source.float_array[ix]; + } + + static float bezier_sampler(sampler const * const sampler, int frame_ix, int parameter_ix, float t) { /* P0 is (INPUT[i] , OUTPUT[i]) @@ -433,14 +439,100 @@ namespace collada_scene { C1 (or T1) is (IN_TANGENT[i+1][0], IN_TANGENT[i+1][1]) P1 is (INPUT[i+1], OUTPUT[i+1]) */ - XMVECTOR p0 = XMVectorSet(sampler->input.float_array[ix], sampler->output.float_array[ix], 0, 0); - XMVECTOR c0 = XMLoadFloat2((XMFLOAT2 *)&sampler->out_tangent.float2_array[ix]); - XMVECTOR c1 = XMLoadFloat2((XMFLOAT2 *)&sampler->in_tangent.float2_array[ix+1]); - XMVECTOR p1 = XMVectorSet(sampler->input.float_array[ix+1], sampler->output.float_array[ix+1], 0, 0); + + float frame0_input = sampler->input.float_array[frame_ix+0]; + float frame1_input = sampler->input.float_array[frame_ix+1]; + + float frame0_output = sampler->output.float_array[(frame_ix+0) * sampler->output.stride + parameter_ix]; + float frame1_output = sampler->output.float_array[(frame_ix+1) * sampler->output.stride + parameter_ix]; + + XMVECTOR p0 = XMVectorSet(frame0_input, frame0_output, 0, 0); + XMVECTOR c0 = XMLoadFloat2(tangent_index(sampler->out_tangent, frame_ix + 0, parameter_ix)); + XMVECTOR c1 = XMLoadFloat2(tangent_index(sampler->in_tangent, frame_ix + 1, parameter_ix)); + XMVECTOR p1 = XMVectorSet(frame1_input, frame1_output, 0, 0); return bezier_binary_search(p0, c0, c1, p1, t); } + static void apply_transform_target(transform& transform, + enum target_attribute channel_target_attribute, + float value) + { + switch (transform.type) { + case transform_type::TRANSLATE: __attribute__((fallthrough)); + case transform_type::SCALE: + switch (channel_target_attribute) { + case target_attribute::X: transform.vector = XMVectorSetX(transform.vector, value); return; + case target_attribute::Y: transform.vector = XMVectorSetY(transform.vector, value); return; + case target_attribute::Z: transform.vector = XMVectorSetZ(transform.vector, value); return; + default: assert(false); + } + case transform_type::ROTATE: + switch (channel_target_attribute) { + case target_attribute::X: transform.vector = XMVectorSetX(transform.vector, value); return; + case target_attribute::Y: transform.vector = XMVectorSetY(transform.vector, value); return; + case target_attribute::Z: transform.vector = XMVectorSetZ(transform.vector, value); return; + case target_attribute::ANGLE: transform.vector = XMVectorSetW(transform.vector, value); return; + default: assert(false); + } + default: + assert(false); + break; + } + } + + static enum target_attribute const rotate_target_attributes[] = { + target_attribute::X, + target_attribute::Y, + target_attribute::Z, + target_attribute::ANGLE, + }; + + static enum target_attribute const translate_scale_target_attributes[] = { + target_attribute::X, + target_attribute::Y, + target_attribute::Z, + }; + + static void animate_channel_segment(channel const& channel, + transform& transform, + int frame_ix, float t) + { + enum target_attribute const * target_attributes = &channel.target_attribute; + int target_attributes_count = 1; + if (channel.target_attribute == target_attribute::ALL) { + switch (transform.type) { + case transform_type::TRANSLATE: __attribute__((fallthrough)); + case transform_type::SCALE: + target_attributes = translate_scale_target_attributes; + target_attributes_count = 3; + break; + case transform_type::ROTATE: + target_attributes = rotate_target_attributes; + target_attributes_count = 4; + break; + default: + assert(false); + break; + } + } + + for (int parameter_ix = 0; parameter_ix < target_attributes_count; parameter_ix++) { + + enum collada::interpolation interpolation = channel.source_sampler->interpolation.interpolation_array[frame_ix]; + + float value; + if (interpolation == interpolation::BEZIER) { + value = bezier_sampler(channel.source_sampler, frame_ix, parameter_ix, t); + } else { + float iv = linear_interpolate_iv(channel.source_sampler->input, frame_ix, t); + value = linear_interpolate_value(channel.source_sampler->output, frame_ix, parameter_ix, iv); + } + + apply_transform_target(transform, target_attributes[parameter_ix], value); + } + } + static void animate_node(node const& node, node_instance& node_instance, float t) { for (int i = 0; i < node.channels_count; i++) { @@ -448,32 +540,9 @@ namespace collada_scene { transform& transform = node_instance.transforms[channel.target_transform_index]; int frame_ix = find_frame_ix(channel.source_sampler->input, t); - if (frame_ix < 0) - continue; // animation is missing a key frame + assert(frame_ix >= 0); // animation is missing a key frame - enum collada::interpolation const * const interpolation = - channel.source_sampler->interpolation.interpolation_array; - - float value; - if (interpolation[frame_ix] == interpolation::BEZIER) { - value = bezier_sampler(channel.source_sampler, frame_ix, t); - } else { - float iv = interpolation_value(channel.source_sampler->input, frame_ix, t); - value = linear_interpolate(channel.source_sampler->output, frame_ix, iv); - } - - switch (transform.type) { - case transform_type::TRANSLATE: - switch (channel.target_attribute) { - case target_attribute::X: transform.translate = XMVectorSetX(transform.translate, value); break; - case target_attribute::Y: transform.translate = XMVectorSetY(transform.translate, value); break; - case target_attribute::Z: transform.translate = XMVectorSetZ(transform.translate, value); break; - default: break; - } - break; - default: - break; - } + animate_channel_segment(channel, transform, frame_ix, t); } } diff --git a/src/main.cpp b/src/main.cpp index bebd4e3..e6273c8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -129,7 +129,7 @@ XMFLOAT4 g_vLightColors[2] = { // -XMVECTOR g_Eye = XMVectorSet(0.0f, -3.0f, 13.0f, 1.0f); +XMVECTOR g_Eye = XMVectorSet(0.0f, -10.0f, 13.0f, 1.0f); XMVECTOR g_At = XMVectorSet(0.0f, 0.0f, 0.0f, 1.0f); // collada scene state diff --git a/src/scenes/curve_interpolation.cpp b/src/scenes/curve_interpolation.cpp new file mode 100644 index 0000000..b9df8d9 --- /dev/null +++ b/src/scenes/curve_interpolation.cpp @@ -0,0 +1,1172 @@ +#include "collada_types.hpp" + +namespace curve_interpolation { + +using namespace collada; + +float const array_node_cube_translation_x_input_array[] = { + 0.0f, + 1.666667f, + 3.333333f, + 5.0f, +}; + +float const array_node_cube_translation_x_output_array[] = { + 10.0f, + -10.0f, + 10.0f, + -10.0f, +}; + +float const array_node_cube_translation_x_intangent_array[] = { + -0.3332306f, 10.0f, + 1.111167f, -10.0f, + 2.778333f, 10.0f, + 4.4445f, -9.219337f, +}; + +float const array_node_cube_translation_x_outtangent_array[] = { + 0.5555f, 10.0f, + 2.222167f, -10.0f, + 3.888333f, 10.0f, + 4.000208f, -8.594958f, +}; + +enum interpolation const array_node_cube_translation_x_interpolation_array[] = { + interpolation::BEZIER, + interpolation::BEZIER, + interpolation::BEZIER, + interpolation::BEZIER, +}; + +sampler const sampler_node_cube_translation_x_sampler = { + // node_cube_translation_x_input + .input = { + .float_array = array_node_cube_translation_x_input_array, + .count = 4, + .stride = 1, + }, + // node_cube_translation_x_output + .output = { + .float_array = array_node_cube_translation_x_output_array, + .count = 4, + .stride = 1, + }, + // node_cube_translation_x_intangent + .in_tangent = { + .float_array = array_node_cube_translation_x_intangent_array, + .count = 4, + .stride = 2, + }, + // node_cube_translation_x_outtangent + .out_tangent = { + .float_array = array_node_cube_translation_x_outtangent_array, + .count = 4, + .stride = 2, + }, + // node_cube_translation_x_interpolation + .interpolation = { + .interpolation_array = array_node_cube_translation_x_interpolation_array, + .count = 4, + .stride = 1, + }, +}; + +float const array_node_cube_translation_y_input_array[] = { + -0.8333334f, + 0.8333334f, + 2.5f, + 4.166667f, +}; + +float const array_node_cube_translation_y_output_array[] = { + -10.05776f, + 10.05852f, + -9.941484f, + 10.05852f, +}; + +float const array_node_cube_translation_y_intangent_array[] = { + -1.166264f, -10.05776f, + 0.2778334f, 10.05852f, + 1.9445f, -9.941484f, + 3.611667f, 10.05852f, +}; + +float const array_node_cube_translation_y_outtangent_array[] = { + -0.2783333f, -10.05776f, + 1.388833f, 10.05852f, + 3.0555f, -9.941484f, + 4.499598f, 10.05852f, +}; + +enum interpolation const array_node_cube_translation_y_interpolation_array[] = { + interpolation::BEZIER, + interpolation::BEZIER, + interpolation::BEZIER, + interpolation::BEZIER, +}; + +sampler const sampler_node_cube_translation_y_sampler = { + // node_cube_translation_y_input + .input = { + .float_array = array_node_cube_translation_y_input_array, + .count = 4, + .stride = 1, + }, + // node_cube_translation_y_output + .output = { + .float_array = array_node_cube_translation_y_output_array, + .count = 4, + .stride = 1, + }, + // node_cube_translation_y_intangent + .in_tangent = { + .float_array = array_node_cube_translation_y_intangent_array, + .count = 4, + .stride = 2, + }, + // node_cube_translation_y_outtangent + .out_tangent = { + .float_array = array_node_cube_translation_y_outtangent_array, + .count = 4, + .stride = 2, + }, + // node_cube_translation_y_interpolation + .interpolation = { + .interpolation_array = array_node_cube_translation_y_interpolation_array, + .count = 4, + .stride = 1, + }, +}; + +float const array_node_torus001_rotationx_angle_input_array[] = { + 0.0f, + 0.8333334f, + 1.666667f, + 2.5f, + 3.333333f, +}; + +float const array_node_torus001_rotationx_angle_output_array[] = { + 0.0f, + -90.0f, + -180.0f, + -270.0f, + -360.0f, +}; + +float const array_node_torus001_rotationx_angle_intangent_array[] = { + 0.9997917f, 0.0f, + 0.3270486f, -89.70257f, + 0.9961964f, -179.1937f, + 1.990403f, -269.8432f, + 2.6534f, -360.0f, +}; + +float const array_node_torus001_rotationx_angle_outtangent_array[] = { + 0.6602973f, 0.0f, + 1.324714f, -90.28867f, + 2.332406f, -180.8006f, + 3.004865f, -270.1553f, + 2.333542f, -360.0f, +}; + +enum interpolation const array_node_torus001_rotationx_angle_interpolation_array[] = { + interpolation::BEZIER, + interpolation::BEZIER, + interpolation::BEZIER, + interpolation::BEZIER, + interpolation::BEZIER, +}; + +sampler const sampler_node_torus001_rotationx_angle_sampler = { + // node_torus001_rotationx_angle_input + .input = { + .float_array = array_node_torus001_rotationx_angle_input_array, + .count = 5, + .stride = 1, + }, + // node_torus001_rotationx_angle_output + .output = { + .float_array = array_node_torus001_rotationx_angle_output_array, + .count = 5, + .stride = 1, + }, + // node_torus001_rotationx_angle_intangent + .in_tangent = { + .float_array = array_node_torus001_rotationx_angle_intangent_array, + .count = 5, + .stride = 2, + }, + // node_torus001_rotationx_angle_outtangent + .out_tangent = { + .float_array = array_node_torus001_rotationx_angle_outtangent_array, + .count = 5, + .stride = 2, + }, + // node_torus001_rotationx_angle_interpolation + .interpolation = { + .interpolation_array = array_node_torus001_rotationx_angle_interpolation_array, + .count = 5, + .stride = 1, + }, +}; + +float const array_node_geosphere001_scale_input_array[] = { + 0.0f, + 1.666667f, + 3.333333f, +}; + +float const array_node_geosphere001_scale_output_array[] = { + 1.0f, 1.0f, 1.0f, + 1.996525f, 1.996525f, 1.996525f, + 1.0f, 1.0f, 1.0f, +}; + +float const array_node_geosphere001_scale_intangent_array[] = { + 0.9997917f, 1.0f, 0.9997917f, 1.0f, 0.9997917f, 1.0f, + 1.111167f, 1.996525f, 1.111167f, 1.996525f, 1.111167f, 1.996525f, + 2.777833f, 1.0f, 2.777833f, 1.0f, 2.777833f, 1.0f, +}; + +float const array_node_geosphere001_scale_outtangent_array[] = { + 0.5555f, 1.0f, 0.5555f, 1.0f, 0.5555f, 1.0f, + 2.222167f, 1.996525f, 2.222167f, 1.996525f, 2.222167f, 1.996525f, + 2.333542f, 1.0f, 2.333542f, 1.0f, 2.333542f, 1.0f, +}; + +enum interpolation const array_node_geosphere001_scale_interpolation_array[] = { + interpolation::BEZIER, + interpolation::BEZIER, + interpolation::BEZIER, +}; + +sampler const sampler_node_geosphere001_scale_sampler = { + // node_geosphere001_scale_input + .input = { + .float_array = array_node_geosphere001_scale_input_array, + .count = 3, + .stride = 1, + }, + // node_geosphere001_scale_output + .output = { + .float_array = array_node_geosphere001_scale_output_array, + .count = 3, + .stride = 3, + }, + // node_geosphere001_scale_intangent + .in_tangent = { + .float_array = array_node_geosphere001_scale_intangent_array, + .count = 3, + .stride = 6, + }, + // node_geosphere001_scale_outtangent + .out_tangent = { + .float_array = array_node_geosphere001_scale_outtangent_array, + .count = 3, + .stride = 6, + }, + // node_geosphere001_scale_interpolation + .interpolation = { + .interpolation_array = array_node_geosphere001_scale_interpolation_array, + .count = 3, + .stride = 1, + }, +}; + +float const array_node_geosphere001_inversescaleaxisrotation_input_array[] = { + 0.0f, + 1.666667f, + 3.333333f, +}; + +float const array_node_geosphere001_inversescaleaxisrotation_output_array[] = { + 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, +}; + +enum interpolation const array_node_geosphere001_inversescaleaxisrotation_interpolation_array[] = { + interpolation::LINEAR, + interpolation::LINEAR, + interpolation::LINEAR, +}; + +sampler const sampler_node_geosphere001_inversescaleaxisrotation_sampler = { + // node_geosphere001_inversescaleaxisrotation_input + .input = { + .float_array = array_node_geosphere001_inversescaleaxisrotation_input_array, + .count = 3, + .stride = 1, + }, + // node_geosphere001_inversescaleaxisrotation_output + .output = { + .float_array = array_node_geosphere001_inversescaleaxisrotation_output_array, + .count = 3, + .stride = 4, + }, + // node_geosphere001_inversescaleaxisrotation_interpolation + .interpolation = { + .interpolation_array = array_node_geosphere001_inversescaleaxisrotation_interpolation_array, + .count = 3, + .stride = 1, + }, +}; + +float const array_node_geosphere001_scaleaxisrotation_input_array[] = { + 0.0f, + 1.666667f, + 3.333333f, +}; + +float const array_node_geosphere001_scaleaxisrotation_output_array[] = { + 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, +}; + +enum interpolation const array_node_geosphere001_scaleaxisrotation_interpolation_array[] = { + interpolation::LINEAR, + interpolation::LINEAR, + interpolation::LINEAR, +}; + +sampler const sampler_node_geosphere001_scaleaxisrotation_sampler = { + // node_geosphere001_scaleaxisrotation_input + .input = { + .float_array = array_node_geosphere001_scaleaxisrotation_input_array, + .count = 3, + .stride = 1, + }, + // node_geosphere001_scaleaxisrotation_output + .output = { + .float_array = array_node_geosphere001_scaleaxisrotation_output_array, + .count = 3, + .stride = 4, + }, + // node_geosphere001_scaleaxisrotation_interpolation + .interpolation = { + .interpolation_array = array_node_geosphere001_scaleaxisrotation_interpolation_array, + .count = 3, + .stride = 1, + }, +}; + +channel const node_channel_node_cube_translation_x = { + .source_sampler = &sampler_node_cube_translation_x_sampler, + .target_transform_index = 0, + .target_attribute = target_attribute::X, +}; + +channel const node_channel_node_cube_translation_y = { + .source_sampler = &sampler_node_cube_translation_y_sampler, + .target_transform_index = 0, + .target_attribute = target_attribute::Y, +}; + +channel const node_channel_node_torus001_rotationx_angle = { + .source_sampler = &sampler_node_torus001_rotationx_angle_sampler, + .target_transform_index = 3, + .target_attribute = target_attribute::ANGLE, +}; + +channel const node_channel_node_geosphere001_scale = { + .source_sampler = &sampler_node_geosphere001_scale_sampler, + .target_transform_index = 2, + .target_attribute = target_attribute::ALL, +}; + +channel const node_channel_node_geosphere001_inversescaleaxisrotation = { + .source_sampler = &sampler_node_geosphere001_inversescaleaxisrotation_sampler, + .target_transform_index = 1, + .target_attribute = target_attribute::ALL, +}; + +channel const node_channel_node_geosphere001_scaleaxisrotation = { + .source_sampler = &sampler_node_geosphere001_scaleaxisrotation_sampler, + .target_transform_index = 3, + .target_attribute = target_attribute::ALL, +}; + +effect const effect_material__15 = { + .type = effect_type::BLINN, + .blinn = { + .emission = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .ambient = { + .color = {0.6705883f, 0.5843138f, 1.0f, 1.0f}, + }, + .diffuse = { + .color = {0.6705883f, 0.5843138f, 1.0f, 1.0f}, + }, + .specular = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .shininess = 10.0f, + .reflective = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .reflectivity = 0.0f, + .transparent = { + .color = {1.0f, 1.0f, 1.0f, 1.0f}, + }, + .transparency = 1.0f, + .index_of_refraction = 0.0f, + } +}; + +effect const effect_material__16 = { + .type = effect_type::BLINN, + .blinn = { + .emission = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .ambient = { + .color = {0.5803922f, 1.0f, 0.9647059f, 1.0f}, + }, + .diffuse = { + .color = {0.5803922f, 1.0f, 0.9647059f, 1.0f}, + }, + .specular = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .shininess = 10.0f, + .reflective = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .reflectivity = 0.0f, + .transparent = { + .color = {1.0f, 1.0f, 1.0f, 1.0f}, + }, + .transparency = 1.0f, + .index_of_refraction = 0.0f, + } +}; + +effect const effect_material__17 = { + .type = effect_type::BLINN, + .blinn = { + .emission = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .ambient = { + .color = {0.6509804f, 1.0f, 0.5803922f, 1.0f}, + }, + .diffuse = { + .color = {0.6509804f, 1.0f, 0.5803922f, 1.0f}, + }, + .specular = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .shininess = 10.0f, + .reflective = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .reflectivity = 0.0f, + .transparent = { + .color = {1.0f, 1.0f, 1.0f, 1.0f}, + }, + .transparency = 1.0f, + .index_of_refraction = 0.0f, + } +}; + +effect const effect_material__18 = { + .type = effect_type::BLINN, + .blinn = { + .emission = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .ambient = { + .color = {0.9333334f, 1.0f, 0.5647059f, 1.0f}, + }, + .diffuse = { + .color = {0.9333334f, 1.0f, 0.5647059f, 1.0f}, + }, + .specular = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .shininess = 10.0f, + .reflective = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .reflectivity = 0.0f, + .transparent = { + .color = {1.0f, 1.0f, 1.0f, 1.0f}, + }, + .transparency = 1.0f, + .index_of_refraction = 0.0f, + } +}; + +effect const effect_material__19 = { + .type = effect_type::BLINN, + .blinn = { + .emission = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .ambient = { + .color = {1.0f, 0.7686275f, 0.5803922f, 1.0f}, + }, + .diffuse = { + .color = {1.0f, 0.7686275f, 0.5803922f, 1.0f}, + }, + .specular = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .shininess = 10.0f, + .reflective = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .reflectivity = 0.0f, + .transparent = { + .color = {1.0f, 1.0f, 1.0f, 1.0f}, + }, + .transparency = 1.0f, + .index_of_refraction = 0.0f, + } +}; + +effect const effect_material__20 = { + .type = effect_type::BLINN, + .blinn = { + .emission = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .ambient = { + .color = {1.0f, 0.5803922f, 0.5803922f, 1.0f}, + }, + .diffuse = { + .color = {1.0f, 0.5803922f, 0.5803922f, 1.0f}, + }, + .specular = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .shininess = 10.0f, + .reflective = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .reflectivity = 0.0f, + .transparent = { + .color = {1.0f, 1.0f, 1.0f, 1.0f}, + }, + .transparency = 1.0f, + .index_of_refraction = 0.0f, + } +}; + +effect const effect_coloreffectr26g177b26 = { + .type = effect_type::PHONG, + .phong = { + .emission = { + .color = {0.0f, 0.0f, 0.0f, 0.0f}, + }, + .ambient = { + .color = {0.1019608f, 0.6941176f, 0.1019608f, 1.0f}, + }, + .diffuse = { + .color = {0.1019608f, 0.6941176f, 0.1019608f, 1.0f}, + }, + .specular = { + .color = {1.0f, 1.0f, 1.0f, 1.0f}, + }, + .shininess = 10.0f, + .reflective = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .reflectivity = 0.0f, + .transparent = { + .color = {1.0f, 1.0f, 1.0f, 1.0f}, + }, + .transparency = 1.0f, + .index_of_refraction = 0.0f, + } +}; + +effect const effect_coloreffectr229g154b215 = { + .type = effect_type::PHONG, + .phong = { + .emission = { + .color = {0.0f, 0.0f, 0.0f, 0.0f}, + }, + .ambient = { + .color = {0.8980392f, 0.6039216f, 0.8431373f, 1.0f}, + }, + .diffuse = { + .color = {0.8980392f, 0.6039216f, 0.8431373f, 1.0f}, + }, + .specular = { + .color = {1.0f, 1.0f, 1.0f, 1.0f}, + }, + .shininess = 10.0f, + .reflective = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .reflectivity = 0.0f, + .transparent = { + .color = {1.0f, 1.0f, 1.0f, 1.0f}, + }, + .transparency = 1.0f, + .index_of_refraction = 0.0f, + } +}; + +effect const effect_coloreffectr28g149b177 = { + .type = effect_type::PHONG, + .phong = { + .emission = { + .color = {0.0f, 0.0f, 0.0f, 0.0f}, + }, + .ambient = { + .color = {0.1098039f, 0.5843137f, 0.6941176f, 1.0f}, + }, + .diffuse = { + .color = {0.1098039f, 0.5843137f, 0.6941176f, 1.0f}, + }, + .specular = { + .color = {1.0f, 1.0f, 1.0f, 1.0f}, + }, + .shininess = 10.0f, + .reflective = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .reflectivity = 0.0f, + .transparent = { + .color = {1.0f, 1.0f, 1.0f, 1.0f}, + }, + .transparency = 1.0f, + .index_of_refraction = 0.0f, + } +}; + +effect const effect_coloreffectr198g224b87 = { + .type = effect_type::PHONG, + .phong = { + .emission = { + .color = {0.0f, 0.0f, 0.0f, 0.0f}, + }, + .ambient = { + .color = {0.7764706f, 0.8784314f, 0.3411765f, 1.0f}, + }, + .diffuse = { + .color = {0.7764706f, 0.8784314f, 0.3411765f, 1.0f}, + }, + .specular = { + .color = {1.0f, 1.0f, 1.0f, 1.0f}, + }, + .shininess = 10.0f, + .reflective = { + .color = {0.0f, 0.0f, 0.0f, 1.0f}, + }, + .reflectivity = 0.0f, + .transparent = { + .color = {1.0f, 1.0f, 1.0f, 1.0f}, + }, + .transparency = 1.0f, + .index_of_refraction = 0.0f, + } +}; + +material const material_coloreffectr26g177b26_material = { + .effect = &effect_coloreffectr26g177b26, +}; + +material const material_coloreffectr229g154b215_material = { + .effect = &effect_coloreffectr229g154b215, +}; + +material const material_coloreffectr28g149b177_material = { + .effect = &effect_coloreffectr28g149b177, +}; + +material const material_coloreffectr198g224b87_material = { + .effect = &effect_coloreffectr198g224b87, +}; + +material const material_material__15_material = { + .effect = &effect_material__15, +}; + +material const material_material__16_material = { + .effect = &effect_material__16, +}; + +material const material_material__17_material = { + .effect = &effect_material__17, +}; + +material const material_material__18_material = { + .effect = &effect_material__18, +}; + +material const material_material__19_material = { + .effect = &effect_material__19, +}; + +material const material_material__20_material = { + .effect = &effect_material__20, +}; + +input_element const input_elements_position_0_3_normal_0_3_texcoord_0_3[] = { + { + .semantic = "POSITION", + .semantic_index = 0, + .format = input_format::FLOAT3, + }, + { + .semantic = "NORMAL", + .semantic_index = 0, + .format = input_format::FLOAT3, + }, + { + .semantic = "TEXCOORD", + .semantic_index = 0, + .format = input_format::FLOAT3, + }, +}; + +triangles const triangles_geom_cube[] = { + { + .count = 2, // triangles + .index_offset = 0, // indices + .inputs_index = 0, // index into inputs_list + }, + { + .count = 2, // triangles + .index_offset = 6, // indices + .inputs_index = 0, // index into inputs_list + }, + { + .count = 2, // triangles + .index_offset = 12, // indices + .inputs_index = 0, // index into inputs_list + }, + { + .count = 2, // triangles + .index_offset = 18, // indices + .inputs_index = 0, // index into inputs_list + }, + { + .count = 2, // triangles + .index_offset = 24, // indices + .inputs_index = 0, // index into inputs_list + }, + { + .count = 2, // triangles + .index_offset = 30, // indices + .inputs_index = 0, // index into inputs_list + }, +}; + +geometry const geometry_geom_cube = { + .mesh = { + .triangles = triangles_geom_cube, + .triangles_count = 6, + + .vertex_buffer_offset = 0, + .vertex_buffer_size = 864, + + .index_buffer_offset = 0, + .index_buffer_size = 144, + } +}; + +triangles const triangles_geom_torus001[] = { + { + .count = 240, // triangles + .index_offset = 0, // indices + .inputs_index = 0, // index into inputs_list + }, +}; + +geometry const geometry_geom_torus001 = { + .mesh = { + .triangles = triangles_geom_torus001, + .triangles_count = 1, + + .vertex_buffer_offset = 864, + .vertex_buffer_size = 5148, + + .index_buffer_offset = 144, + .index_buffer_size = 2880, + } +}; + +triangles const triangles_geom_cylinder001[] = { + { + .count = 30, // triangles + .index_offset = 0, // indices + .inputs_index = 0, // index into inputs_list + }, +}; + +geometry const geometry_geom_cylinder001 = { + .mesh = { + .triangles = triangles_geom_cylinder001, + .triangles_count = 1, + + .vertex_buffer_offset = 6012, + .vertex_buffer_size = 1152, + + .index_buffer_offset = 3024, + .index_buffer_size = 360, + } +}; + +triangles const triangles_geom_plane001[] = { + { + .count = 2, // triangles + .index_offset = 0, // indices + .inputs_index = 0, // index into inputs_list + }, +}; + +geometry const geometry_geom_plane001 = { + .mesh = { + .triangles = triangles_geom_plane001, + .triangles_count = 1, + + .vertex_buffer_offset = 7164, + .vertex_buffer_size = 144, + + .index_buffer_offset = 3384, + .index_buffer_size = 24, + } +}; + +triangles const triangles_geom_geosphere001[] = { + { + .count = 40, // triangles + .index_offset = 0, // indices + .inputs_index = 0, // index into inputs_list + }, +}; + +geometry const geometry_geom_geosphere001 = { + .mesh = { + .triangles = triangles_geom_geosphere001, + .triangles_count = 1, + + .vertex_buffer_offset = 7308, + .vertex_buffer_size = 4320, + + .index_buffer_offset = 3408, + .index_buffer_size = 480, + } +}; + +geometry const * const geometries[] = { + &geometry_geom_cube, + &geometry_geom_torus001, + &geometry_geom_cylinder001, + &geometry_geom_plane001, + &geometry_geom_geosphere001, +}; + +transform const transforms_node_environmentambientlight[] = { +}; + +instance_geometry const instance_geometries_node_environmentambientlight[] = { +}; + +channel const * const node_channels_node_environmentambientlight[] = {}; + +node const node_node_environmentambientlight = { + .parent_index = -1, + + .type = node_type::NODE, + + .transforms = transforms_node_environmentambientlight, + .transforms_count = 0, + + .instance_geometries = instance_geometries_node_environmentambientlight, + .instance_geometries_count = 0, + + .channels = node_channels_node_environmentambientlight, + .channels_count = 0, +}; + +transform const transforms_node_cube[] = { + { + .type = transform_type::TRANSLATE, + .translate = {10.0f, -1.14258e-07f, 0.0f}, + }, +}; + +instance_material const instance_materials_node_cube_0[] = { + { + .element_index = 1, // an index into mesh.triangles + .material = &material_material__15_material, + }, + { + .element_index = 0, // an index into mesh.triangles + .material = &material_material__16_material, + }, + { + .element_index = 5, // an index into mesh.triangles + .material = &material_material__17_material, + }, + { + .element_index = 4, // an index into mesh.triangles + .material = &material_material__20_material, + }, + { + .element_index = 3, // an index into mesh.triangles + .material = &material_material__18_material, + }, + { + .element_index = 2, // an index into mesh.triangles + .material = &material_material__19_material, + }, +}; + +instance_geometry const instance_geometries_node_cube[] = { + { + .geometry = &geometry_geom_cube, + .instance_materials = instance_materials_node_cube_0, + .instance_materials_count = 6, + }, +}; + +channel const * const node_channels_node_cube[] = { + &node_channel_node_cube_translation_y, + &node_channel_node_cube_translation_x, +}; + +node const node_node_cube = { + .parent_index = -1, + + .type = node_type::NODE, + + .transforms = transforms_node_cube, + .transforms_count = 1, + + .instance_geometries = instance_geometries_node_cube, + .instance_geometries_count = 1, + + .channels = node_channels_node_cube, + .channels_count = 2, +}; + +transform const transforms_node_torus001[] = { + { + .type = transform_type::TRANSLATE, + .translate = {5.0f, 1.14258e-07f, 2.0f}, + }, + { + .type = transform_type::ROTATE, + .rotate = {0.0f, 0.0f, 1.0f, 0.0f}, + }, + { + .type = transform_type::ROTATE, + .rotate = {0.0f, 1.0f, 0.0f, 2.00358e-05f}, + }, + { + .type = transform_type::ROTATE, + .rotate = {1.0f, 0.0f, 0.0f, 0.0f}, + }, + { + .type = transform_type::SCALE, + .scale = {0.5f, 0.5f, 0.5f}, + }, +}; + +instance_material const instance_materials_node_torus001_0[] = { + { + .element_index = 0, // an index into mesh.triangles + .material = &material_coloreffectr26g177b26_material, + }, +}; + +instance_geometry const instance_geometries_node_torus001[] = { + { + .geometry = &geometry_geom_torus001, + .instance_materials = instance_materials_node_torus001_0, + .instance_materials_count = 1, + }, +}; + +channel const * const node_channels_node_torus001[] = { + &node_channel_node_torus001_rotationx_angle, +}; + +node const node_node_torus001 = { + .parent_index = 1, + + .type = node_type::NODE, + + .transforms = transforms_node_torus001, + .transforms_count = 5, + + .instance_geometries = instance_geometries_node_torus001, + .instance_geometries_count = 1, + + .channels = node_channels_node_torus001, + .channels_count = 1, +}; + +transform const transforms_node_cylinder001[] = { +}; + +instance_material const instance_materials_node_cylinder001_0[] = { + { + .element_index = 0, // an index into mesh.triangles + .material = &material_coloreffectr229g154b215_material, + }, +}; + +instance_geometry const instance_geometries_node_cylinder001[] = { + { + .geometry = &geometry_geom_cylinder001, + .instance_materials = instance_materials_node_cylinder001_0, + .instance_materials_count = 1, + }, +}; + +channel const * const node_channels_node_cylinder001[] = { +}; + +node const node_node_cylinder001 = { + .parent_index = -1, + + .type = node_type::NODE, + + .transforms = transforms_node_cylinder001, + .transforms_count = 0, + + .instance_geometries = instance_geometries_node_cylinder001, + .instance_geometries_count = 1, + + .channels = node_channels_node_cylinder001, + .channels_count = 0, +}; + +transform const transforms_node_plane001[] = { + { + .type = transform_type::TRANSLATE, + .translate = {0.0f, 0.0f, 0.01f}, + }, + { + .type = transform_type::ROTATE, + .rotate = {0.0f, 0.0f, -1.0f, -44.99999f}, + }, +}; + +instance_material const instance_materials_node_plane001_0[] = { + { + .element_index = 0, // an index into mesh.triangles + .material = &material_coloreffectr28g149b177_material, + }, +}; + +instance_geometry const instance_geometries_node_plane001[] = { + { + .geometry = &geometry_geom_plane001, + .instance_materials = instance_materials_node_plane001_0, + .instance_materials_count = 1, + }, +}; + +channel const * const node_channels_node_plane001[] = { +}; + +node const node_node_plane001 = { + .parent_index = -1, + + .type = node_type::NODE, + + .transforms = transforms_node_plane001, + .transforms_count = 2, + + .instance_geometries = instance_geometries_node_plane001, + .instance_geometries_count = 1, + + .channels = node_channels_node_plane001, + .channels_count = 0, +}; + +transform const transforms_node_geosphere001[] = { + { + .type = transform_type::TRANSLATE, + .translate = {0.03164387f, -0.03838623f, 0.0f}, + }, + { + .type = transform_type::ROTATE, + .rotate = {0.0f, 0.0f, 0.0f, 0.0f}, + }, + { + .type = transform_type::SCALE, + .scale = {1.0f, 1.0f, 1.0f}, + }, + { + .type = transform_type::ROTATE, + .rotate = {0.0f, 0.0f, 0.0f, 0.0f}, + }, +}; + +instance_material const instance_materials_node_geosphere001_0[] = { + { + .element_index = 0, // an index into mesh.triangles + .material = &material_coloreffectr198g224b87_material, + }, +}; + +instance_geometry const instance_geometries_node_geosphere001[] = { + { + .geometry = &geometry_geom_geosphere001, + .instance_materials = instance_materials_node_geosphere001_0, + .instance_materials_count = 1, + }, +}; + +channel const * const node_channels_node_geosphere001[] = { + &node_channel_node_geosphere001_inversescaleaxisrotation, + &node_channel_node_geosphere001_scale, + &node_channel_node_geosphere001_scaleaxisrotation, +}; + +node const node_node_geosphere001 = { + .parent_index = -1, + + .type = node_type::NODE, + + .transforms = transforms_node_geosphere001, + .transforms_count = 4, + + .instance_geometries = instance_geometries_node_geosphere001, + .instance_geometries_count = 1, + + .channels = node_channels_node_geosphere001, + .channels_count = 3, +}; + +node const * const nodes[] = { + &node_node_environmentambientlight, + &node_node_cube, + &node_node_torus001, + &node_node_cylinder001, + &node_node_plane001, + &node_node_geosphere001, +}; + +inputs const inputs_list[] = { + { + .elements = input_elements_position_0_3_normal_0_3_texcoord_0_3, + .elements_count = 3, + }, +}; + +extern collada::descriptor const descriptor; + +collada::descriptor const descriptor = { + .nodes = nodes, + .nodes_count = (sizeof (nodes)) / (sizeof (nodes[0])), + + .inputs_list = inputs_list, + .inputs_list_count = (sizeof (inputs_list)) / (sizeof (inputs_list[0])), +}; + +}