Compare commits
2 Commits
4e98fe2684
...
0c4af14977
| Author | SHA1 | Date | |
|---|---|---|---|
| 0c4af14977 | |||
| fcbaf7ab66 |
4
Makefile
4
Makefile
@ -55,6 +55,7 @@ SCENES = \
|
||||
src/scenes/curve_interpolation/curve_interpolation.cpp
|
||||
|
||||
include curve_interpolation.mk
|
||||
include ship20.mk
|
||||
|
||||
RC_FILES = $(wildcard rc/*.rc)
|
||||
|
||||
@ -91,7 +92,8 @@ OBJS = \
|
||||
$(BUILD_TYPE)/dds_validate.obj \
|
||||
$(BUILD_TYPE)/collada.obj \
|
||||
$(BUILD_TYPE)/collada_scene.obj \
|
||||
$(BUILD_TYPE)/scenes/curve_interpolation/curve_interpolation.obj
|
||||
$(BUILD_TYPE)/scenes/curve_interpolation/curve_interpolation.obj \
|
||||
$(BUILD_TYPE)/scenes/ship20/ship20.obj
|
||||
|
||||
$(BUILD_TYPE)/d3d10.exe: $(OBJS)
|
||||
@mkdir -p $(@D)
|
||||
|
||||
@ -61,7 +61,11 @@ class State:
|
||||
# effect_textures_by_texcoord: (effect_id, channel): [sampler_sid]
|
||||
effect_textures_by_texcoord: Dict[Tuple[str, str], list]
|
||||
|
||||
def __init__(self):
|
||||
# input_filename
|
||||
input_filename: str
|
||||
relative_path: bool
|
||||
|
||||
def __init__(self, input_filename):
|
||||
self.vertex_buffer = BytesIO()
|
||||
self.index_buffer = BytesIO()
|
||||
self.joints_weights_vertex_buffer = BytesIO()
|
||||
@ -76,6 +80,8 @@ class State:
|
||||
self.image_indices = {}
|
||||
self.resource_names = {}
|
||||
self.effect_textures_by_texcoord = defaultdict(list)
|
||||
self.input_filename = input_filename
|
||||
self.relative_path = False
|
||||
|
||||
def _sanitize(name):
|
||||
return name.replace(' ', '_').replace('-', '_').replace('.', '_').replace('/', '_')
|
||||
@ -228,7 +234,7 @@ def render_node_transforms(state, collada, node_name, transformation_elements):
|
||||
yield "},"
|
||||
elif type(transform) is types.Matrix:
|
||||
yield ".type = transform_type::MATRIX,"
|
||||
yield f".matrix = {render_float_tuple(matrix_transpose(transform.matrix))},"
|
||||
yield f".matrix = {render_float_tuple(matrix_transpose(transform.values))},"
|
||||
elif type(transform) is types.Rotate:
|
||||
yield ".type = transform_type::ROTATE,"
|
||||
yield f".rotate = {render_float_tuple(transform.rotate)},"
|
||||
@ -507,7 +513,7 @@ def render_library_visual_scenes(state, collada):
|
||||
for node_index, node in enumerate(state.linearized_nodes):
|
||||
node_name_id = get_node_name_id(node)
|
||||
node_name = sanitize_name(state, node_name_id, node)
|
||||
yield f"&node_{node_name},"
|
||||
yield f"&node_{node_name}, // {node_index}"
|
||||
yield "};"
|
||||
|
||||
def render_header(namespace):
|
||||
@ -852,9 +858,11 @@ def render_library_lights(state, collada):
|
||||
|
||||
def image_resource_name(state, uri):
|
||||
uri = unquote(uri)
|
||||
prefix = "file:///"
|
||||
assert uri.startswith(prefix), uri
|
||||
path = uri[len(prefix):]
|
||||
file_prefix = "file:///"
|
||||
path = uri[len(file_prefix):] if uri.startswith(file_prefix) else uri
|
||||
if not os.path.isabs(path) and not os.path.exists(path):
|
||||
path = os.path.join(os.path.dirname(state.input_filename), path)
|
||||
state.relative_path = True
|
||||
assert os.path.exists(path), path
|
||||
image_extensions = {".png", ".jpg", ".bmp", ".jpeg", ".tiff"}
|
||||
assert os.path.splitext(path)[1].lower() in image_extensions, path
|
||||
@ -959,14 +967,38 @@ def render_controller(state, collada, controller):
|
||||
yield "};"
|
||||
|
||||
def render_library_controllers(state, collada):
|
||||
for library_controller in collada.library_controllers:
|
||||
for controller in library_controller.controllers:
|
||||
for library_controllers in collada.library_controllers:
|
||||
for controller in library_controllers.controllers:
|
||||
yield from render_controller(state, collada, controller)
|
||||
|
||||
def render_all(collada, namespace):
|
||||
state = State()
|
||||
def render_camera(state, collada, camera):
|
||||
camera_name = sanitize_name(state, camera.id, camera)
|
||||
perspective = camera.optics.technique_common.projection_type
|
||||
assert type(perspective) is types.Perspective
|
||||
def nf(f):
|
||||
if f is None:
|
||||
return float(0)
|
||||
else:
|
||||
return f
|
||||
|
||||
yield f"camera const camera_{camera_name} = {{"
|
||||
yield f".xfov = {nf(perspective.xfov)}f,"
|
||||
yield f".yfov = {nf(perspective.yfov)}f,"
|
||||
yield f".znear = {nf(perspective.znear)}f,"
|
||||
yield f".zfar = {nf(perspective.zfar)}f,"
|
||||
yield f".aspect_ratio = {nf(perspective.aspect_ratio)}f,"
|
||||
yield "};"
|
||||
|
||||
def render_library_cameras(state, collada):
|
||||
for library_cameras in collada.library_cameras:
|
||||
for camera in library_cameras.cameras:
|
||||
yield from render_camera(state, collada, camera)
|
||||
|
||||
def render_all(collada, namespace, input_filename):
|
||||
state = State(input_filename)
|
||||
render, out = renderer()
|
||||
render(render_header(namespace))
|
||||
render(render_library_cameras(state, collada))
|
||||
render(render_library_lights(state, collada))
|
||||
render(render_library_animations(state, collada))
|
||||
render(render_library_images(state, collada))
|
||||
@ -996,5 +1028,5 @@ if __name__ == "__main__":
|
||||
import sys
|
||||
collada = parse.parse_collada_file(sys.argv[1])
|
||||
|
||||
state, out = render_all(collada, "test")
|
||||
state, out = render_all(collada, "test", "./test.DAE")
|
||||
print(out.getvalue())
|
||||
|
||||
@ -65,7 +65,7 @@ def main():
|
||||
|
||||
collada = parse.parse_collada_file(input_collada)
|
||||
namespace = parse_namespace(input_collada)
|
||||
state, out_source = header.render_all(collada, namespace)
|
||||
state, out_source = header.render_all(collada, namespace, input_collada)
|
||||
|
||||
with open(output_source, 'wb') as f:
|
||||
source_buf = out_source.getvalue()
|
||||
|
||||
@ -649,12 +649,7 @@ def parse_matrix(lookup, sid_lookup, root):
|
||||
values = [float(i) for i in root.text.strip().split()]
|
||||
assert len(values) == 16
|
||||
|
||||
r0 = tuple(values[0:4])
|
||||
r1 = tuple(values[4:8])
|
||||
r2 = tuple(values[8:12])
|
||||
r3 = tuple(values[12:16])
|
||||
|
||||
matrix = types.Matrix(sid, tuple([r0, r1, r2, r3]))
|
||||
matrix = types.Matrix(sid, values)
|
||||
lookup_add(sid_lookup, sid, matrix)
|
||||
return matrix
|
||||
|
||||
@ -1022,6 +1017,85 @@ def parse_library_controllers(lookup, root):
|
||||
lookup_add(lookup, id, library_controllers)
|
||||
return library_controllers
|
||||
|
||||
def parse_perspective(lookup, root):
|
||||
xfov = None
|
||||
yfov = None
|
||||
znear = None
|
||||
zfar = None
|
||||
aspect_ratio = None
|
||||
for child in root.getchildren():
|
||||
assert len(child.getchildren()) == 0
|
||||
if child.tag == tag("xfov"):
|
||||
assert xfov is None
|
||||
xfov = float(child.text.strip())
|
||||
if child.tag == tag("yfov"):
|
||||
assert yfov is None
|
||||
yfov = float(child.text.strip())
|
||||
if child.tag == tag("znear"):
|
||||
assert znear is None
|
||||
znear = float(child.text.strip())
|
||||
if child.tag == tag("zfar"):
|
||||
assert zfar is None
|
||||
zfar = float(child.text.strip())
|
||||
if child.tag == tag("aspect_ratio"):
|
||||
assert aspect_ratio is None
|
||||
aspect_ratio = float(child.text.strip())
|
||||
perspective = types.Perspective(xfov, yfov, znear, zfar, aspect_ratio)
|
||||
return perspective
|
||||
|
||||
def parse_technique_common_optics(lookup, root):
|
||||
projection_type = None
|
||||
for child in root.getchildren():
|
||||
if child.tag == tag("perspective"):
|
||||
assert projection_type is None
|
||||
projection_type = parse_perspective(lookup, child)
|
||||
if child.tag == tag("orthographic"):
|
||||
assert projection_type is None
|
||||
assert False, child.tag
|
||||
assert projection_type is not None
|
||||
optics = types.TechniqueCommon_Optics(projection_type)
|
||||
return optics
|
||||
|
||||
def parse_optics(lookup, root):
|
||||
technique_common = None
|
||||
for child in root.getchildren():
|
||||
if child.tag == tag("technique_common"):
|
||||
assert technique_common is None
|
||||
technique_common = parse_technique_common_optics(lookup, child)
|
||||
assert technique_common is not None
|
||||
optics = types.Optics(technique_common)
|
||||
return optics
|
||||
|
||||
def parse_camera(lookup, root):
|
||||
id = root.attrib.get("id")
|
||||
name = root.attrib.get("name")
|
||||
|
||||
optics = None
|
||||
for child in root.getchildren():
|
||||
if child.tag == tag("optics"):
|
||||
assert optics is None
|
||||
optics = parse_optics(lookup, child)
|
||||
|
||||
assert optics is not None
|
||||
camera = types.Camera(id, name, optics)
|
||||
lookup_add(lookup, id, camera)
|
||||
return camera
|
||||
|
||||
def parse_library_cameras(lookup, root):
|
||||
id = root.attrib.get("id")
|
||||
name = root.attrib.get("name")
|
||||
|
||||
cameras = []
|
||||
for child in root.getchildren():
|
||||
if child.tag == tag("camera"):
|
||||
cameras.append(parse_camera(lookup, child))
|
||||
|
||||
assert len(cameras) >= 1
|
||||
|
||||
library_cameras = types.LibraryCameras(id, name, cameras)
|
||||
lookup_add(lookup, id, library_cameras)
|
||||
return library_cameras
|
||||
|
||||
def parse_collada(tree):
|
||||
root = tree.getroot()
|
||||
assert root.tag == tag("COLLADA")
|
||||
@ -1030,6 +1104,8 @@ def parse_collada(tree):
|
||||
lookup = {}
|
||||
|
||||
for child in root.getchildren():
|
||||
if child.tag == tag("library_cameras"):
|
||||
collada.library_cameras.append(parse_library_cameras(lookup, child))
|
||||
if child.tag == tag("library_animations"):
|
||||
collada.library_animations.append(parse_library_animations(lookup, child))
|
||||
if child.tag == tag("library_controllers"):
|
||||
|
||||
@ -519,8 +519,39 @@ class LibraryAnimations:
|
||||
|
||||
animations: List[Animation] # 1 or more
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Perspective:
|
||||
xfov: float
|
||||
yfov: float
|
||||
znear: float
|
||||
zfar: float
|
||||
aspect_ratio: float
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class TechniqueCommon_Optics:
|
||||
projection_type: Union[Perspective]
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Optics:
|
||||
technique_common: TechniqueCommon_Optics
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Camera:
|
||||
id: Optional[ID]
|
||||
name: Optional[str]
|
||||
|
||||
optics: Optics
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class LibraryCameras:
|
||||
id: Optional[ID]
|
||||
name: Optional[str]
|
||||
|
||||
cameras: List[Camera] # 1 or more
|
||||
|
||||
@dataclass
|
||||
class Collada:
|
||||
library_cameras: List[LibraryCameras]
|
||||
library_animations: List[LibraryAnimations]
|
||||
library_controllers: List[LibraryControllers]
|
||||
library_effects: List[LibraryEffects]
|
||||
@ -533,6 +564,7 @@ class Collada:
|
||||
_lookup: dict = field(repr=False)
|
||||
|
||||
def __init__(self):
|
||||
self.library_cameras = []
|
||||
self.library_animations = []
|
||||
self.library_controllers = []
|
||||
self.library_effects = []
|
||||
|
||||
@ -3,6 +3,11 @@ image/american_cherry.DDS: C:/Program\ Files/Common\ Files/Autodesk\ Shared/Mate
|
||||
texconv10.exe -f BC1_UNORM -nologo "$<"
|
||||
mv "$(<:.png=.DDS)" "$@"
|
||||
|
||||
IMAGES += image/Masonry.Unit\ Masonry.Glass\ Block.Square.Stack.DDS
|
||||
image/Masonry.Unit\ Masonry.Glass\ Block.Square.Stack.DDS: C:/Program\ Files/Common\ Files/Autodesk\ Shared/Materials/Textures/2/Mats/Masonry.Unit\ Masonry.Glass\ Block.Square.Stack.jpg
|
||||
texconv10.exe -f BC1_UNORM -nologo "$<"
|
||||
mv "$(<:.jpg=.DDS)" "$@"
|
||||
|
||||
IMAGES += image/102.DDS
|
||||
image/102.DDS: C:/Program\ Files/Common\ Files/Autodesk\ Shared/Materials/Textures/3/Mats/102.png
|
||||
texconv10.exe -f BC1_UNORM -nologo "$<"
|
||||
|
||||
@ -349,6 +349,14 @@ namespace collada {
|
||||
};
|
||||
*/
|
||||
|
||||
struct camera {
|
||||
float xfov;
|
||||
float yfov;
|
||||
float znear;
|
||||
float zfar;
|
||||
float aspect_ratio;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// scene
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
3
include/scenes/ship20/ship20.hpp
Normal file
3
include/scenes/ship20/ship20.hpp
Normal file
@ -0,0 +1,3 @@
|
||||
namespace ship20 {
|
||||
extern collada::descriptor const descriptor;
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
_AMERICAN_CHERRY_PNG RCDATA "image/american_cherry.DDS"
|
||||
_MASONRY_UNIT_MASONRY_GLASS_BLOCK_SQUARE_STACK_JPG RCDATA "image/Masonry.Unit Masonry.Glass Block.Square.Stack.DDS"
|
||||
_102_PNG RCDATA "image/102.DDS"
|
||||
_FINISHES_FLOORING_TILE_SQUARE_MEDIUM_BLUE_PNG RCDATA "image/Finishes.Flooring.Tile.Square.Medium Blue.DDS"
|
||||
_SITEWORK_PLANTING_GRASS_BERMUDA1_JPG RCDATA "image/SiteWork.Planting.Grass.Bermuda1.DDS"
|
||||
|
||||
@ -14,3 +14,7 @@ RES_COLLADA_SCENE_FXO RCDATA "collada_scene.fxo"
|
||||
RES_MODELS_CURVE_INTERPOLATION_VTX RCDATA "scenes/curve_interpolation/curve_interpolation.vtx"
|
||||
RES_MODELS_CURVE_INTERPOLATION_IDX RCDATA "scenes/curve_interpolation/curve_interpolation.idx"
|
||||
RES_MODELS_CURVE_INTERPOLATION_VJW RCDATA "scenes/curve_interpolation/curve_interpolation.vjw"
|
||||
|
||||
RES_SCENES_SHIP20_VTX RCDATA "scenes/ship20/ship20.vtx"
|
||||
RES_SCENES_SHIP20_IDX RCDATA "scenes/ship20/ship20.idx"
|
||||
RES_SCENES_SHIP20_VJW RCDATA "scenes/ship20/ship20.vjw"
|
||||
|
||||
1
rc/ship20.rc
Normal file
1
rc/ship20.rc
Normal file
@ -0,0 +1 @@
|
||||
_0_SHIPPLE2_PNG RCDATA "image/0_shipple2.DDS"
|
||||
@ -6,8 +6,8 @@
|
||||
<authoring_tool>OpenCOLLADA for 3ds Max; Version: 1.6; Revision: 68</authoring_tool>
|
||||
<source_data>file:///C:/cygwin/home/bilbo/d3d10/scenes/curve_interpolation/curve_interpolation.max</source_data>
|
||||
</contributor>
|
||||
<created>2026-01-30T14:43:57</created>
|
||||
<modified>2026-01-30T14:43:57</modified>
|
||||
<created>2026-02-01T17:48:55</created>
|
||||
<modified>2026-02-01T17:48:55</modified>
|
||||
<unit name="inch" meter="0.0254"/>
|
||||
<up_axis>Z_UP</up_axis>
|
||||
</asset>
|
||||
@ -957,6 +957,72 @@
|
||||
</technique>
|
||||
</extra>
|
||||
</effect>
|
||||
<effect id="Material__21">
|
||||
<profile_COMMON>
|
||||
<newparam sid="Masonry_Unit_Masonry_Glass_Block_Square_Stack_jpg-surface">
|
||||
<surface type="2D">
|
||||
<init_from>Masonry_Unit_Masonry_Glass_Block_Square_Stack_jpg</init_from>
|
||||
</surface>
|
||||
</newparam>
|
||||
<newparam sid="Masonry_Unit_Masonry_Glass_Block_Square_Stack_jpg-sampler">
|
||||
<sampler2D>
|
||||
<source>Masonry_Unit_Masonry_Glass_Block_Square_Stack_jpg-surface</source>
|
||||
</sampler2D>
|
||||
</newparam>
|
||||
<technique sid="common">
|
||||
<blinn>
|
||||
<emission>
|
||||
<color>0 0 0 1</color>
|
||||
</emission>
|
||||
<ambient>
|
||||
<color>0.588 0.588 0.588 1</color>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<texture texture="Masonry_Unit_Masonry_Glass_Block_Square_Stack_jpg-sampler" texcoord="CHANNEL1"/>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<color>0 0 0 1</color>
|
||||
</specular>
|
||||
<shininess>
|
||||
<float>10</float>
|
||||
</shininess>
|
||||
<reflective>
|
||||
<color>0 0 0 1</color>
|
||||
</reflective>
|
||||
<transparent opaque="A_ONE">
|
||||
<color>1 1 1 1</color>
|
||||
</transparent>
|
||||
<transparency>
|
||||
<float>1</float>
|
||||
</transparency>
|
||||
</blinn>
|
||||
</technique>
|
||||
</profile_COMMON>
|
||||
<extra>
|
||||
<technique profile="OpenCOLLADA3dsMax">
|
||||
<extended_shader>
|
||||
<opacity_type sid="opacity_type" type="int">0</opacity_type>
|
||||
<falloff_type sid="falloff_type" type="int">0</falloff_type>
|
||||
<falloff sid="falloff" type="float">0</falloff>
|
||||
<index_of_refraction sid="index_of_refraction" type="float">1.5</index_of_refraction>
|
||||
<wire_size sid="wire_size" type="float">1</wire_size>
|
||||
<wire_units sid="wire_units" type="int">0</wire_units>
|
||||
<apply_reflection_dimming sid="apply_reflection_dimming" type="bool">0</apply_reflection_dimming>
|
||||
<dim_level sid="dim_level" type="float">0</dim_level>
|
||||
<reflection_level sid="reflection_level" type="float">3</reflection_level>
|
||||
</extended_shader>
|
||||
<shader>
|
||||
<ambient_diffuse_texture_lock sid="ambient_diffuse_texture_lock" type="bool">1</ambient_diffuse_texture_lock>
|
||||
<ambient_diffuse_lock sid="ambient_diffuse_lock" type="bool">1</ambient_diffuse_lock>
|
||||
<diffuse_specular_lock sid="diffuse_specular_lock" type="bool">0</diffuse_specular_lock>
|
||||
<use_self_illum_color sid="use_self_illum_color" type="bool">0</use_self_illum_color>
|
||||
<self_illumination sid="self_illumination" type="float">0</self_illumination>
|
||||
<specular_level sid="specular_level" type="float">0</specular_level>
|
||||
<soften sid="soften" type="float">0.1</soften>
|
||||
</shader>
|
||||
</technique>
|
||||
</extra>
|
||||
</effect>
|
||||
</library_effects>
|
||||
<library_materials>
|
||||
<material id="ColorEffectR26G177B26-material" name="ColorEffectR26G177B26-material">
|
||||
@ -1010,6 +1076,9 @@
|
||||
<material id="Material__18_1-material" name="Material__18">
|
||||
<instance_effect url="#Material__18_1"/>
|
||||
</material>
|
||||
<material id="Material__21-material" name="Material__21">
|
||||
<instance_effect url="#Material__21"/>
|
||||
</material>
|
||||
</library_materials>
|
||||
<library_geometries>
|
||||
<geometry id="geom-Cube" name="Cube">
|
||||
@ -1406,6 +1475,62 @@
|
||||
</triangles>
|
||||
</mesh>
|
||||
</geometry>
|
||||
<geometry id="geom-Pyramid001" name="Pyramid001">
|
||||
<mesh>
|
||||
<source id="geom-Pyramid001-positions">
|
||||
<float_array id="geom-Pyramid001-positions-array" count="18">0 0 10.01329 -11.77238 -7.848255 0 11.77238 -7.848255 0 11.77238 7.848255 0 -11.77238 7.848255 0 0 0 0</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#geom-Pyramid001-positions-array" count="6" stride="3">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
<param name="Z" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="geom-Pyramid001-normals">
|
||||
<float_array id="geom-Pyramid001-normals-array" count="51">0 -0.7870559 0.6168815 0 -0.7870559 0.6168816 0 -0.7870559 0.6168816 0.6479026 0 0.7617232 0.6479026 0 0.7617232 0.6479026 0 0.7617232 0 0.7870559 0.6168815 0 0.7870559 0.6168816 0 0.7870559 0.6168816 -0.6479026 0 0.7617232 -0.6479026 0 0.7617232 -0.6479026 0 0.7617232 0 0 -0.9999999 0 0 -1 0 0 -0.9999999 0 0 -0.9999999 0 0 -0.9999999</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#geom-Pyramid001-normals-array" count="17" stride="3">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
<param name="Z" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="geom-Pyramid001-map1">
|
||||
<float_array id="geom-Pyramid001-map1-array" count="33">0.5 1 0 0 0 0 1 0 0 -0.25 0 0 0.75 0 0 0 1 0 1 1 0 1 0 0 0 0 0 0.5 0.5 0 0.5 1 0</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#geom-Pyramid001-map1-array" count="11" stride="3">
|
||||
<param name="S" type="float"/>
|
||||
<param name="T" type="float"/>
|
||||
<param name="P" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<vertices id="geom-Pyramid001-vertices">
|
||||
<input semantic="POSITION" source="#geom-Pyramid001-positions"/>
|
||||
</vertices>
|
||||
<triangles material="Material__21_1" count="8">
|
||||
<input semantic="VERTEX" source="#geom-Pyramid001-vertices" offset="0"/>
|
||||
<input semantic="NORMAL" source="#geom-Pyramid001-normals" offset="1"/>
|
||||
<input semantic="TEXCOORD" source="#geom-Pyramid001-map1" offset="2" set="0"/>
|
||||
<p>0 0 0 1 1 1 2 2 2 0 3 10 2 4 3 3 5 4 0 6 0 3 7 1 4 8 2 0 9 10 4 10 3 1 11 4 1 12 5 5 13 9 2 14 6 2 14 6 5 13 9 3 15 7 3 15 7 5 13 9 4 16 8 4 16 8 5 13 9 1 12 5</p>
|
||||
</triangles>
|
||||
</mesh>
|
||||
<extra>
|
||||
<technique profile="OpenCOLLADA3dsMax">
|
||||
<max_pyramid>
|
||||
<width sid="width" type="float">23.54476</width>
|
||||
<depth sid="depth" type="float">15.69651</depth>
|
||||
<height sid="height" type="float">10.01329</height>
|
||||
<widthsegments sid="widthsegments" type="int">1</widthsegments>
|
||||
<depthsegments sid="depthsegments" type="int">1</depthsegments>
|
||||
<heightsegments sid="heightsegments" type="int">1</heightsegments>
|
||||
<generateuvs sid="generateuvs" type="int">1</generateuvs>
|
||||
</max_pyramid>
|
||||
</technique>
|
||||
</extra>
|
||||
</geometry>
|
||||
</library_geometries>
|
||||
<library_controllers>
|
||||
<controller id="geom-Box001-skin1">
|
||||
@ -1492,6 +1617,9 @@
|
||||
<image id="american_cherry_png">
|
||||
<init_from>file:///C:/Program%20Files/Common%20Files/Autodesk%20Shared/Materials/Textures/1/Mats/american_cherry.png</init_from>
|
||||
</image>
|
||||
<image id="Masonry_Unit_Masonry_Glass_Block_Square_Stack_jpg">
|
||||
<init_from>file:///C:/Program%20Files/Common%20Files/Autodesk%20Shared/Materials/Textures/2/Mats/Masonry.Unit%20Masonry.Glass%20Block.Square.Stack.jpg</init_from>
|
||||
</image>
|
||||
<image id="_02_png">
|
||||
<init_from>file:///C:/Program%20Files/Common%20Files/Autodesk%20Shared/Materials/Textures/3/Mats/102.png</init_from>
|
||||
</image>
|
||||
@ -1514,9 +1642,9 @@
|
||||
<bind_material>
|
||||
<technique_common>
|
||||
<instance_material symbol="Material__15_1" target="#Material__15-material"/>
|
||||
<instance_material symbol="Material__17_1" target="#Material__17-material"/>
|
||||
<instance_material symbol="Material__16_1" target="#Material__16-material"/>
|
||||
<instance_material symbol="Material__18_1" target="#Material__18-material"/>
|
||||
<instance_material symbol="Material__17_1" target="#Material__17-material"/>
|
||||
<instance_material symbol="Material__19_1" target="#Material__19-material"/>
|
||||
<instance_material symbol="Material__20_1" target="#Material__20-material"/>
|
||||
</technique_common>
|
||||
@ -1655,8 +1783,8 @@
|
||||
<bind_material>
|
||||
<technique_common>
|
||||
<instance_material symbol="Material__13_1" target="#Material__13-material"/>
|
||||
<instance_material symbol="Material__15" target="#Material__15_1-material"/>
|
||||
<instance_material symbol="Material__14_1" target="#Material__14-material"/>
|
||||
<instance_material symbol="Material__15" target="#Material__15_1-material"/>
|
||||
<instance_material symbol="Material__16" target="#Material__16_1-material"/>
|
||||
<instance_material symbol="Material__17" target="#Material__17_1-material"/>
|
||||
<instance_material symbol="Material__18" target="#Material__18_1-material"/>
|
||||
@ -1697,6 +1825,29 @@
|
||||
</technique>
|
||||
</extra>
|
||||
</node>
|
||||
<node id="node-Pyramid001" name="Pyramid001">
|
||||
<translate sid="translation">10.76371 -13.71933 0.01108826</translate>
|
||||
<rotate sid="rotationZ">0 0 1 0</rotate>
|
||||
<rotate sid="rotationY">0 1 0 0</rotate>
|
||||
<rotate sid="rotationX">1 0 0 0</rotate>
|
||||
<instance_geometry url="#geom-Pyramid001">
|
||||
<bind_material>
|
||||
<technique_common>
|
||||
<instance_material symbol="Material__21_1" target="#Material__21-material">
|
||||
<bind_vertex_input semantic="CHANNEL1" input_semantic="TEXCOORD" input_set="0"/>
|
||||
</instance_material>
|
||||
</technique_common>
|
||||
</bind_material>
|
||||
</instance_geometry>
|
||||
<extra>
|
||||
<technique profile="OpenCOLLADA">
|
||||
<cast_shadows sid="cast_shadows" type="bool">1</cast_shadows>
|
||||
<receive_shadows sid="receive_shadows" type="bool">1</receive_shadows>
|
||||
<primary_visibility sid="primary_visibility" type="int">1</primary_visibility>
|
||||
<secondary_visibility sid="secondary_visibility" type="int">1</secondary_visibility>
|
||||
</technique>
|
||||
</extra>
|
||||
</node>
|
||||
</visual_scene>
|
||||
</library_visual_scenes>
|
||||
<library_animations>
|
||||
@ -2059,6 +2210,258 @@
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_translation.X-input">
|
||||
<float_array id="node-Pyramid001_translation.X-input-array" count="4">0 0.6333333 1.466667 3.333333</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_translation.X-input-array" count="4" stride="1">
|
||||
<param name="TIME" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_translation.X-output">
|
||||
<float_array id="node-Pyramid001_translation.X-output-array" count="4">10.76371 10.76371 10.76371 10.76371</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_translation.X-output-array" count="4" stride="1">
|
||||
<param name="X" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_translation.X-intangent">
|
||||
<float_array id="node-Pyramid001_translation.X-intangent-array" count="8">0.9997917 10.76371 0.4222434 10.76371 1.188917 10.76371 2.711174 10.76371</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_translation.X-intangent-array" count="4" stride="2">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_translation.X-outtangent">
|
||||
<float_array id="node-Pyramid001_translation.X-outtangent-array" count="8">0.21109 10.76371 0.9110833 10.76371 2.088827 10.76371 3.666564 10.76371</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_translation.X-outtangent-array" count="4" stride="2">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_translation.X-interpolation">
|
||||
<Name_array id="node-Pyramid001_translation.X-interpolation-array" count="4">BEZIER BEZIER BEZIER BEZIER</Name_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_translation.X-interpolation-array" count="4" stride="1">
|
||||
<param name="INTERPOLATION" type="name"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_translation.Y-input">
|
||||
<float_array id="node-Pyramid001_translation.Y-input-array" count="4">0 0.6333333 1.466667 3.333333</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_translation.Y-input-array" count="4" stride="1">
|
||||
<param name="TIME" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_translation.Y-output">
|
||||
<float_array id="node-Pyramid001_translation.Y-output-array" count="4">-13.71933 -13.71933 11.03402 -13.71933</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_translation.Y-output-array" count="4" stride="1">
|
||||
<param name="Y" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_translation.Y-intangent">
|
||||
<float_array id="node-Pyramid001_translation.Y-intangent-array" count="8">0.9997917 -13.71933 0.4222434 -13.71933 1.188917 11.03402 2.711174 -13.71933</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_translation.Y-intangent-array" count="4" stride="2">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_translation.Y-outtangent">
|
||||
<float_array id="node-Pyramid001_translation.Y-outtangent-array" count="8">0.21109 -13.71933 0.9110833 -13.71933 2.088827 11.03402 3.666564 -13.71933</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_translation.Y-outtangent-array" count="4" stride="2">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_translation.Y-interpolation">
|
||||
<Name_array id="node-Pyramid001_translation.Y-interpolation-array" count="4">BEZIER BEZIER BEZIER BEZIER</Name_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_translation.Y-interpolation-array" count="4" stride="1">
|
||||
<param name="INTERPOLATION" type="name"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_translation.Z-input">
|
||||
<float_array id="node-Pyramid001_translation.Z-input-array" count="4">0 0.6333333 1.466667 3.333333</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_translation.Z-input-array" count="4" stride="1">
|
||||
<param name="TIME" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_translation.Z-output">
|
||||
<float_array id="node-Pyramid001_translation.Z-output-array" count="4">0.01108826 17.80861 17.80861 0.01108826</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_translation.Z-output-array" count="4" stride="1">
|
||||
<param name="Z" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_translation.Z-intangent">
|
||||
<float_array id="node-Pyramid001_translation.Z-intangent-array" count="8">0.9997917 0.01108826 0.4222434 17.80861 1.188917 17.80861 2.711174 0.01108826</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_translation.Z-intangent-array" count="4" stride="2">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_translation.Z-outtangent">
|
||||
<float_array id="node-Pyramid001_translation.Z-outtangent-array" count="8">0.21109 0.01108826 0.9110833 17.80861 2.088827 17.80861 3.666564 0.01108826</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_translation.Z-outtangent-array" count="4" stride="2">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_translation.Z-interpolation">
|
||||
<Name_array id="node-Pyramid001_translation.Z-interpolation-array" count="4">BEZIER BEZIER BEZIER BEZIER</Name_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_translation.Z-interpolation-array" count="4" stride="1">
|
||||
<param name="INTERPOLATION" type="name"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_rotationZ.ANGLE-input">
|
||||
<float_array id="node-Pyramid001_rotationZ.ANGLE-input-array" count="5">0 1.466667 2.366667 2.8 3.333333</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_rotationZ.ANGLE-input-array" count="5" stride="1">
|
||||
<param name="TIME" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_rotationZ.ANGLE-output">
|
||||
<float_array id="node-Pyramid001_rotationZ.ANGLE-output-array" count="5">0 0 0 0 0</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_rotationZ.ANGLE-output-array" count="5" stride="1">
|
||||
<param name="ANGLE" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_rotationZ.ANGLE-intangent">
|
||||
<float_array id="node-Pyramid001_rotationZ.ANGLE-intangent-array" count="10">0.9997917 0 0.9778267 0 2.066697 0 2.65557 0 3.155573 0</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_rotationZ.ANGLE-intangent-array" count="5" stride="2">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_rotationZ.ANGLE-outtangent">
|
||||
<float_array id="node-Pyramid001_rotationZ.ANGLE-outtangent-array" count="10">0.48884 0 1.766637 0 2.511097 0 2.97776 0 3.666564 0</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_rotationZ.ANGLE-outtangent-array" count="5" stride="2">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_rotationZ.ANGLE-interpolation">
|
||||
<Name_array id="node-Pyramid001_rotationZ.ANGLE-interpolation-array" count="5">BEZIER BEZIER BEZIER BEZIER BEZIER</Name_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_rotationZ.ANGLE-interpolation-array" count="5" stride="1">
|
||||
<param name="INTERPOLATION" type="name"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_rotationY.ANGLE-input">
|
||||
<float_array id="node-Pyramid001_rotationY.ANGLE-input-array" count="5">0 1.466667 2.366667 2.8 3.333333</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_rotationY.ANGLE-input-array" count="5" stride="1">
|
||||
<param name="TIME" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_rotationY.ANGLE-output">
|
||||
<float_array id="node-Pyramid001_rotationY.ANGLE-output-array" count="5">0 0 0 0 0</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_rotationY.ANGLE-output-array" count="5" stride="1">
|
||||
<param name="ANGLE" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_rotationY.ANGLE-intangent">
|
||||
<float_array id="node-Pyramid001_rotationY.ANGLE-intangent-array" count="10">0.9997917 0 0.9778267 0 2.066697 0 2.65557 0 3.155573 0</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_rotationY.ANGLE-intangent-array" count="5" stride="2">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_rotationY.ANGLE-outtangent">
|
||||
<float_array id="node-Pyramid001_rotationY.ANGLE-outtangent-array" count="10">0.48884 0 1.766637 0 2.511097 0 2.97776 0 3.666564 0</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_rotationY.ANGLE-outtangent-array" count="5" stride="2">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_rotationY.ANGLE-interpolation">
|
||||
<Name_array id="node-Pyramid001_rotationY.ANGLE-interpolation-array" count="5">BEZIER BEZIER BEZIER BEZIER BEZIER</Name_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_rotationY.ANGLE-interpolation-array" count="5" stride="1">
|
||||
<param name="INTERPOLATION" type="name"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_rotationX.ANGLE-input">
|
||||
<float_array id="node-Pyramid001_rotationX.ANGLE-input-array" count="5">0 1.466667 2.366667 2.8 3.333333</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_rotationX.ANGLE-input-array" count="5" stride="1">
|
||||
<param name="TIME" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_rotationX.ANGLE-output">
|
||||
<float_array id="node-Pyramid001_rotationX.ANGLE-output-array" count="5">0 -69.99999 -175 -235 0</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_rotationX.ANGLE-output-array" count="5" stride="1">
|
||||
<param name="ANGLE" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_rotationX.ANGLE-intangent">
|
||||
<float_array id="node-Pyramid001_rotationX.ANGLE-intangent-array" count="10">0.9997917 0 0.9778267 -69.99999 2.066697 -175 2.65557 -235 3.155573 0</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_rotationX.ANGLE-intangent-array" count="5" stride="2">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_rotationX.ANGLE-outtangent">
|
||||
<float_array id="node-Pyramid001_rotationX.ANGLE-outtangent-array" count="10">0.48884 0 1.766637 -69.99999 2.511097 -175 2.97776 -235 3.666564 0</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_rotationX.ANGLE-outtangent-array" count="5" stride="2">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="node-Pyramid001_rotationX.ANGLE-interpolation">
|
||||
<Name_array id="node-Pyramid001_rotationX.ANGLE-interpolation-array" count="5">BEZIER BEZIER BEZIER BEZIER BEZIER</Name_array>
|
||||
<technique_common>
|
||||
<accessor source="#node-Pyramid001_rotationX.ANGLE-interpolation-array" count="5" stride="1">
|
||||
<param name="INTERPOLATION" type="name"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<sampler id="node-Cube_translation.X-sampler">
|
||||
<input semantic="INPUT" source="#node-Cube_translation.X-input"/>
|
||||
<input semantic="OUTPUT" source="#node-Cube_translation.X-output"/>
|
||||
@ -2118,6 +2521,48 @@
|
||||
<input semantic="OUT_TANGENT" source="#node-Bone002_rotationZ.ANGLE-outtangent"/>
|
||||
<input semantic="INTERPOLATION" source="#node-Bone002_rotationZ.ANGLE-interpolation"/>
|
||||
</sampler>
|
||||
<sampler id="node-Pyramid001_translation.X-sampler">
|
||||
<input semantic="INPUT" source="#node-Pyramid001_translation.X-input"/>
|
||||
<input semantic="OUTPUT" source="#node-Pyramid001_translation.X-output"/>
|
||||
<input semantic="IN_TANGENT" source="#node-Pyramid001_translation.X-intangent"/>
|
||||
<input semantic="OUT_TANGENT" source="#node-Pyramid001_translation.X-outtangent"/>
|
||||
<input semantic="INTERPOLATION" source="#node-Pyramid001_translation.X-interpolation"/>
|
||||
</sampler>
|
||||
<sampler id="node-Pyramid001_translation.Y-sampler">
|
||||
<input semantic="INPUT" source="#node-Pyramid001_translation.Y-input"/>
|
||||
<input semantic="OUTPUT" source="#node-Pyramid001_translation.Y-output"/>
|
||||
<input semantic="IN_TANGENT" source="#node-Pyramid001_translation.Y-intangent"/>
|
||||
<input semantic="OUT_TANGENT" source="#node-Pyramid001_translation.Y-outtangent"/>
|
||||
<input semantic="INTERPOLATION" source="#node-Pyramid001_translation.Y-interpolation"/>
|
||||
</sampler>
|
||||
<sampler id="node-Pyramid001_translation.Z-sampler">
|
||||
<input semantic="INPUT" source="#node-Pyramid001_translation.Z-input"/>
|
||||
<input semantic="OUTPUT" source="#node-Pyramid001_translation.Z-output"/>
|
||||
<input semantic="IN_TANGENT" source="#node-Pyramid001_translation.Z-intangent"/>
|
||||
<input semantic="OUT_TANGENT" source="#node-Pyramid001_translation.Z-outtangent"/>
|
||||
<input semantic="INTERPOLATION" source="#node-Pyramid001_translation.Z-interpolation"/>
|
||||
</sampler>
|
||||
<sampler id="node-Pyramid001_rotationZ.ANGLE-sampler">
|
||||
<input semantic="INPUT" source="#node-Pyramid001_rotationZ.ANGLE-input"/>
|
||||
<input semantic="OUTPUT" source="#node-Pyramid001_rotationZ.ANGLE-output"/>
|
||||
<input semantic="IN_TANGENT" source="#node-Pyramid001_rotationZ.ANGLE-intangent"/>
|
||||
<input semantic="OUT_TANGENT" source="#node-Pyramid001_rotationZ.ANGLE-outtangent"/>
|
||||
<input semantic="INTERPOLATION" source="#node-Pyramid001_rotationZ.ANGLE-interpolation"/>
|
||||
</sampler>
|
||||
<sampler id="node-Pyramid001_rotationY.ANGLE-sampler">
|
||||
<input semantic="INPUT" source="#node-Pyramid001_rotationY.ANGLE-input"/>
|
||||
<input semantic="OUTPUT" source="#node-Pyramid001_rotationY.ANGLE-output"/>
|
||||
<input semantic="IN_TANGENT" source="#node-Pyramid001_rotationY.ANGLE-intangent"/>
|
||||
<input semantic="OUT_TANGENT" source="#node-Pyramid001_rotationY.ANGLE-outtangent"/>
|
||||
<input semantic="INTERPOLATION" source="#node-Pyramid001_rotationY.ANGLE-interpolation"/>
|
||||
</sampler>
|
||||
<sampler id="node-Pyramid001_rotationX.ANGLE-sampler">
|
||||
<input semantic="INPUT" source="#node-Pyramid001_rotationX.ANGLE-input"/>
|
||||
<input semantic="OUTPUT" source="#node-Pyramid001_rotationX.ANGLE-output"/>
|
||||
<input semantic="IN_TANGENT" source="#node-Pyramid001_rotationX.ANGLE-intangent"/>
|
||||
<input semantic="OUT_TANGENT" source="#node-Pyramid001_rotationX.ANGLE-outtangent"/>
|
||||
<input semantic="INTERPOLATION" source="#node-Pyramid001_rotationX.ANGLE-interpolation"/>
|
||||
</sampler>
|
||||
<channel source="#node-Cube_translation.X-sampler" target="node-Cube/translation.X"/>
|
||||
<channel source="#node-Cube_translation.Y-sampler" target="node-Cube/translation.Y"/>
|
||||
<channel source="#node-Torus_rotationX.ANGLE-sampler" target="node-Torus/rotationX.ANGLE"/>
|
||||
@ -2127,6 +2572,12 @@
|
||||
<channel source="#node-Light_translation.X-sampler" target="node-Light/translation.X"/>
|
||||
<channel source="#node-Light_translation.Y-sampler" target="node-Light/translation.Y"/>
|
||||
<channel source="#node-Bone002_rotationZ.ANGLE-sampler" target="node-Bone002/rotationZ.ANGLE"/>
|
||||
<channel source="#node-Pyramid001_translation.X-sampler" target="node-Pyramid001/translation.X"/>
|
||||
<channel source="#node-Pyramid001_translation.Y-sampler" target="node-Pyramid001/translation.Y"/>
|
||||
<channel source="#node-Pyramid001_translation.Z-sampler" target="node-Pyramid001/translation.Z"/>
|
||||
<channel source="#node-Pyramid001_rotationZ.ANGLE-sampler" target="node-Pyramid001/rotationZ.ANGLE"/>
|
||||
<channel source="#node-Pyramid001_rotationY.ANGLE-sampler" target="node-Pyramid001/rotationY.ANGLE"/>
|
||||
<channel source="#node-Pyramid001_rotationX.ANGLE-sampler" target="node-Pyramid001/rotationX.ANGLE"/>
|
||||
</animation>
|
||||
</library_animations>
|
||||
<scene>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
scenes/ship20/images/0_shipple2.png
Executable file
BIN
scenes/ship20/images/0_shipple2.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
399
scenes/ship20/ship20.DAE
Executable file
399
scenes/ship20/ship20.DAE
Executable file
File diff suppressed because one or more lines are too long
BIN
scenes/ship20/ship20.idx
Normal file
BIN
scenes/ship20/ship20.idx
Normal file
Binary file not shown.
0
scenes/ship20/ship20.vjw
Normal file
0
scenes/ship20/ship20.vjw
Normal file
BIN
scenes/ship20/ship20.vtx
Normal file
BIN
scenes/ship20/ship20.vtx
Normal file
Binary file not shown.
5
ship20.mk
Normal file
5
ship20.mk
Normal file
@ -0,0 +1,5 @@
|
||||
IMAGES += image/0_shipple2.DDS
|
||||
image/0_shipple2.DDS: scenes/ship20/./images/0_shipple2.png
|
||||
texconv10.exe -f BC1_UNORM -nologo "$<"
|
||||
mv "$(<:.png=.DDS)" "$@"
|
||||
|
||||
@ -209,15 +209,15 @@ namespace collada_scene {
|
||||
if (FAILED(hr))
|
||||
return E_FAIL;
|
||||
|
||||
hr = LoadVertexBuffer(L"RES_MODELS_CURVE_INTERPOLATION_VTX", &m_pVertexBuffers[0]);
|
||||
hr = LoadVertexBuffer(L"RES_SCENES_SHIP20_VTX", &m_pVertexBuffers[0]);
|
||||
if (FAILED(hr))
|
||||
return E_FAIL;
|
||||
|
||||
hr = LoadVertexBuffer(L"RES_MODELS_CURVE_INTERPOLATION_VJW", &m_pVertexBuffers[1]);
|
||||
hr = LoadVertexBuffer(L"RES_SCENES_SHIP20_VJW", &m_pVertexBuffers[1]);
|
||||
if (FAILED(hr))
|
||||
return E_FAIL;
|
||||
|
||||
hr = LoadIndexBuffer(L"RES_MODELS_CURVE_INTERPOLATION_IDX", &m_pIndexBuffer);
|
||||
hr = LoadIndexBuffer(L"RES_SCENES_SHIP20_IDX", &m_pIndexBuffer);
|
||||
if (FAILED(hr))
|
||||
return E_FAIL;
|
||||
|
||||
@ -378,6 +378,10 @@ namespace collada_scene {
|
||||
return E_FAIL;
|
||||
}
|
||||
DWORD dwResSize = SizeofResource(NULL, hRes);
|
||||
if (dwResSize == 0) {
|
||||
*ppVertexBuffer = NULL;
|
||||
return S_OK;
|
||||
}
|
||||
void * pData = LockResource(LoadResource(NULL, hRes));
|
||||
|
||||
D3D10_BUFFER_DESC bd;
|
||||
@ -437,6 +441,8 @@ namespace collada_scene {
|
||||
XMConvertToRadians(XMVectorGetW(transform.vector)));
|
||||
case transform_type::SCALE:
|
||||
return XMMatrixScalingFromVector(transform.vector);
|
||||
case transform_type::MATRIX:
|
||||
return transform.matrix;
|
||||
default:
|
||||
assert(false);
|
||||
break;
|
||||
@ -851,7 +857,7 @@ namespace collada_scene {
|
||||
|
||||
g_pViewEyeVariable->SetFloatVector((float *)&eye);
|
||||
|
||||
int lights = min(2, m_lightInstancesCount);
|
||||
int lights = min(4, m_lightInstancesCount);
|
||||
g_pLightPosVariable->SetFloatVectorArray((float *)m_lightPositions, 0, lights);
|
||||
g_pLightDirVariable->SetFloatVectorArray((float *)m_lightDirections, 0, lights);
|
||||
g_pLightColorVariable->SetFloatVectorArray((float *)m_lightColors, 0, lights);
|
||||
|
||||
@ -5,9 +5,9 @@ cbuffer cbEveryFrame
|
||||
|
||||
float4 ViewEye;
|
||||
|
||||
float4 LightPos[2];
|
||||
float4 LightDir[2];
|
||||
float4 LightColor[2];
|
||||
float4 LightPos[4];
|
||||
float4 LightDir[4];
|
||||
float4 LightColor[4];
|
||||
};
|
||||
|
||||
cbuffer cbMultiplePerFrame
|
||||
@ -66,6 +66,12 @@ struct PS_INPUT
|
||||
float4 WPos : POSITION;
|
||||
};
|
||||
|
||||
struct PS_OUTPUT
|
||||
{
|
||||
float4 color0 : SV_TARGET0;
|
||||
float4 color1 : SV_TARGET1;
|
||||
};
|
||||
|
||||
PS_INPUT VSSkin(VS_INPUT_SKINNED input)
|
||||
{
|
||||
PS_INPUT output;
|
||||
@ -99,38 +105,48 @@ PS_INPUT VS(VS_INPUT input)
|
||||
output.Pos = mul(output.Pos, Projection);
|
||||
|
||||
output.Norm = mul(input.Norm, (float3x3)World);
|
||||
output.Tex = input.Tex;
|
||||
output.Tex = float2(input.Tex.x, 1 - input.Tex.y);
|
||||
|
||||
output.WPos = world_pos;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
float4 PS(PS_INPUT input) : SV_Target
|
||||
PS_OUTPUT PS(PS_INPUT input)
|
||||
{
|
||||
float3 normal = normalize(input.Norm);
|
||||
float3 view_dir = normalize(ViewEye.xyz - input.WPos.xyz);
|
||||
|
||||
float3 color = Emission.xyz;
|
||||
float3 emissionColor = float3(0, 0, 0);
|
||||
|
||||
if (TextureChannel.x >= 0) { // emission
|
||||
emissionColor = TexEmission.Sample(samLinear, input.Tex).xyz;
|
||||
} else {
|
||||
emissionColor = Emission.xyz;
|
||||
}
|
||||
|
||||
float3 diffuseColor;
|
||||
if (TextureChannel.z >= 0) {
|
||||
if (TextureChannel.z >= 0) { // diffuse
|
||||
diffuseColor = TexDiffuse.Sample(samLinear, input.Tex).xyz;
|
||||
} else {
|
||||
diffuseColor = Diffuse.xyz;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
float3 color = emissionColor;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
float3 light_dir = normalize(-LightDir[i].xyz);
|
||||
float diffuse_intensity = max(dot(normal, light_dir), 0.0) + 0.2;
|
||||
|
||||
float distance = length(LightPos[i].xyz - input.WPos.xyz);
|
||||
float attenuation = 1.0 / (0.002 * distance * distance);
|
||||
float attenuation = 1.0 / (0.00000006 * distance * distance * distance);
|
||||
|
||||
color += diffuseColor * diffuse_intensity * LightColor[i].xyz * attenuation;
|
||||
}
|
||||
|
||||
return float4(color.xyz, 1);
|
||||
PS_OUTPUT output;
|
||||
output.color0 = float4(color, 1.0);
|
||||
output.color1 = float4(emissionColor, 1.0);
|
||||
return output;
|
||||
}
|
||||
|
||||
BlendState DisableBlending
|
||||
|
||||
39
src/main.cpp
39
src/main.cpp
@ -21,6 +21,7 @@
|
||||
#include "collada_scene.hpp"
|
||||
|
||||
#include "scenes/curve_interpolation/curve_interpolation.hpp"
|
||||
#include "scenes/ship20/ship20.hpp"
|
||||
|
||||
HINSTANCE g_hInstance = NULL;
|
||||
HWND g_hWnd = NULL;
|
||||
@ -129,7 +130,7 @@ XMFLOAT4 g_vLightColors[2] = {
|
||||
|
||||
//
|
||||
|
||||
XMVECTOR g_Eye = XMVectorSet(0.0f, -40.0f, 25.0f, 1.0f);
|
||||
XMVECTOR g_Eye = XMVectorSet(0.0f, -260.0f, 260.0f, 1.0f);
|
||||
XMVECTOR g_At = XMVectorSet(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
// collada scene state
|
||||
@ -208,7 +209,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
|
||||
print("collada_scene::LoadEffect\n");
|
||||
}
|
||||
|
||||
if (FAILED(g_SceneState.load_scene(&curve_interpolation::descriptor))) {
|
||||
if (FAILED(g_SceneState.load_scene(&ship20::descriptor))) {
|
||||
print("g_SceneState::load_scene\n");
|
||||
return 0;
|
||||
}
|
||||
@ -283,7 +284,8 @@ HRESULT InitWindow(HINSTANCE hInstance, int nCmdShow)
|
||||
return E_FAIL;
|
||||
|
||||
// create window
|
||||
RECT rc = { 0, 0, 512, 512 };
|
||||
//RECT rc = { 0, 0, 512, 512 };
|
||||
RECT rc = { 0, 0, 1365, 1024 };
|
||||
AdjustWindowRect(&rc, WS_OVERLAPPEDWINDOW, FALSE);
|
||||
UINT width = rc.right - rc.left;
|
||||
UINT height = rc.bottom - rc.top;
|
||||
@ -1105,6 +1107,24 @@ HRESULT InitDirect3DDevice()
|
||||
|
||||
g_pd3dDevice->RSSetState(pRState);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// depth stencil state
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
D3D10_DEPTH_STENCIL_DESC dsDesc;
|
||||
dsDesc.DepthEnable = true;
|
||||
dsDesc.DepthWriteMask = D3D10_DEPTH_WRITE_MASK_ALL;
|
||||
dsDesc.DepthFunc = D3D10_COMPARISON_LESS;
|
||||
dsDesc.StencilEnable = false;
|
||||
|
||||
// Create depth stencil state
|
||||
ID3D10DepthStencilState * pDSState;
|
||||
g_pd3dDevice->CreateDepthStencilState(&dsDesc, &pDSState);
|
||||
|
||||
g_pd3dDevice->OMSetDepthStencilState(pDSState, 1);
|
||||
*/
|
||||
|
||||
//
|
||||
|
||||
InitDirect3DViews();
|
||||
@ -1225,8 +1245,8 @@ HRESULT InitDirect3DDevice()
|
||||
float fFov = XM_PI * 0.5f;
|
||||
float fAspect = width / (float)height;
|
||||
float fNear = 0.1f;
|
||||
float fFar = 100.0f;
|
||||
g_Projection = XMMatrixPerspectiveFovLH(fFov,
|
||||
float fFar = 1000.0f;
|
||||
g_Projection = XMMatrixPerspectiveFovRH(fFov,
|
||||
fAspect,
|
||||
fNear,
|
||||
fFar);
|
||||
@ -1261,7 +1281,7 @@ BOOL Resize()
|
||||
|
||||
InitDirect3DViews();
|
||||
|
||||
float fFov = XM_PI * 0.5f;
|
||||
float fFov = XM_PI * 1.0f;
|
||||
float fAspect = width / (float)height;
|
||||
float fNear = 0.1f;
|
||||
float fFar = 100.0f;
|
||||
@ -1735,8 +1755,7 @@ void Update(float t, float dt)
|
||||
g_Eye = XMVector4Transform(g_Eye, mTranslateView * mRotateView);
|
||||
XMVECTOR Up = XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f);
|
||||
|
||||
g_View = XMMatrixLookAtLH(g_Eye, g_At, Up);
|
||||
|
||||
g_View = XMMatrixLookAtRH(g_Eye, g_At, Up);
|
||||
}
|
||||
|
||||
void RenderVolume(float t)
|
||||
@ -1818,7 +1837,7 @@ void Render(float t, float dt)
|
||||
{
|
||||
// clear
|
||||
|
||||
const float ClearColor[4] = { 0.2f, 0.125f, 0.2f, 1.0f };
|
||||
const float ClearColor[4] = { 0.2f * 0.2f, 0.125f * 0.2f, 0.2f * 0.2f, 1.0f };
|
||||
g_pd3dDevice->OMSetRenderTargets(1, &g_pRenderTargetView, g_pDepthStencilView);
|
||||
g_pd3dDevice->ClearRenderTargetView(g_pRenderTargetView, ClearColor);
|
||||
g_pd3dDevice->ClearDepthStencilView(g_pDepthStencilView, D3D10_CLEAR_DEPTH, 1.0f, 0);
|
||||
@ -1845,6 +1864,8 @@ void Render(float t, float dt)
|
||||
g_SceneState.update(t);
|
||||
g_SceneState.render();
|
||||
|
||||
RenderBloom();
|
||||
|
||||
RenderFont(dt);
|
||||
|
||||
// present
|
||||
|
||||
@ -543,15 +543,15 @@ float const array_node_bone002_rotationz_angle_input_array[] = {
|
||||
};
|
||||
|
||||
float const array_node_bone002_rotationz_angle_output_array[] = {
|
||||
180.0f + 180.0f,
|
||||
230.0f + 180.0f,
|
||||
180.0f + 180.0f,
|
||||
130.0f + 180.0f,
|
||||
180.0f + 180.0f,
|
||||
230.0f + 180.0f,
|
||||
180.0f + 180.0f,
|
||||
130.0f + 180.0f,
|
||||
180.0f + 180.0f,
|
||||
180.0f,
|
||||
230.0f,
|
||||
180.0f,
|
||||
130.0f,
|
||||
180.0f,
|
||||
230.0f,
|
||||
180.0f,
|
||||
130.0f,
|
||||
180.0f,
|
||||
};
|
||||
|
||||
float const array_node_bone002_rotationz_angle_intangent_array[] = {
|
||||
@ -1660,6 +1660,15 @@ instance_material const instance_geometry_instance_materials_node_cube_0[] = {
|
||||
.diffuse = { .input_set = -1 },
|
||||
.specular = { .input_set = -1 },
|
||||
},
|
||||
{
|
||||
.element_index = 5, // an index into mesh.triangles
|
||||
.material = &material_material__17_material,
|
||||
|
||||
.emission = { .input_set = -1 },
|
||||
.ambient = { .input_set = -1 },
|
||||
.diffuse = { .input_set = -1 },
|
||||
.specular = { .input_set = -1 },
|
||||
},
|
||||
{
|
||||
.element_index = 0, // an index into mesh.triangles
|
||||
.material = &material_material__16_material,
|
||||
@ -1678,15 +1687,6 @@ instance_material const instance_geometry_instance_materials_node_cube_0[] = {
|
||||
.diffuse = { .input_set = -1 },
|
||||
.specular = { .input_set = -1 },
|
||||
},
|
||||
{
|
||||
.element_index = 5, // an index into mesh.triangles
|
||||
.material = &material_material__17_material,
|
||||
|
||||
.emission = { .input_set = -1 },
|
||||
.ambient = { .input_set = -1 },
|
||||
.diffuse = { .input_set = -1 },
|
||||
.specular = { .input_set = -1 },
|
||||
},
|
||||
{
|
||||
.element_index = 2, // an index into mesh.triangles
|
||||
.material = &material_material__19_material,
|
||||
@ -2044,8 +2044,8 @@ instance_light const instance_lights_node_light[] = {
|
||||
};
|
||||
|
||||
channel const * const node_channels_node_light[] = {
|
||||
&node_channel_node_light_translation_y,
|
||||
&node_channel_node_light_translation_x,
|
||||
&node_channel_node_light_translation_y,
|
||||
};
|
||||
|
||||
node const node_node_light = {
|
||||
@ -2139,15 +2139,6 @@ int const joint_node_indices_node_box001_geom_box001_skin1[] = {
|
||||
};
|
||||
|
||||
instance_material const instance_controller_instance_materials_node_box001_0[] = {
|
||||
{
|
||||
.element_index = 0, // an index into mesh.triangles
|
||||
.material = &material_material__14_material,
|
||||
|
||||
.emission = { .input_set = -1 },
|
||||
.ambient = { .input_set = -1 },
|
||||
.diffuse = { .input_set = -1 },
|
||||
.specular = { .input_set = -1 },
|
||||
},
|
||||
{
|
||||
.element_index = 1, // an index into mesh.triangles
|
||||
.material = &material_material__13_material,
|
||||
@ -2166,6 +2157,15 @@ instance_material const instance_controller_instance_materials_node_box001_0[] =
|
||||
.diffuse = { .input_set = -1 },
|
||||
.specular = { .input_set = -1 },
|
||||
},
|
||||
{
|
||||
.element_index = 0, // an index into mesh.triangles
|
||||
.material = &material_material__14_material,
|
||||
|
||||
.emission = { .input_set = -1 },
|
||||
.ambient = { .input_set = -1 },
|
||||
.diffuse = { .input_set = -1 },
|
||||
.specular = { .input_set = -1 },
|
||||
},
|
||||
{
|
||||
.element_index = 3, // an index into mesh.triangles
|
||||
.material = &material_material__16_1_material,
|
||||
@ -2328,17 +2328,17 @@ node const node_node_bone002 = {
|
||||
};
|
||||
|
||||
node const * const nodes[] = {
|
||||
&node_node_environmentambientlight,
|
||||
&node_node_cube,
|
||||
&node_node_torus,
|
||||
&node_node_cylinder,
|
||||
&node_node_plane,
|
||||
&node_node_geosphere,
|
||||
&node_node_light,
|
||||
&node_node_lightindicator,
|
||||
&node_node_box001,
|
||||
&node_node_bone001,
|
||||
&node_node_bone002,
|
||||
&node_node_environmentambientlight, // 0
|
||||
&node_node_cube, // 1
|
||||
&node_node_torus, // 2
|
||||
&node_node_cylinder, // 3
|
||||
&node_node_plane, // 4
|
||||
&node_node_geosphere, // 5
|
||||
&node_node_light, // 6
|
||||
&node_node_lightindicator, // 7
|
||||
&node_node_box001, // 8
|
||||
&node_node_bone001, // 9
|
||||
&node_node_bone002, // 10
|
||||
};
|
||||
|
||||
inputs const inputs_list[] = {
|
||||
|
||||
425
src/scenes/ship20/ship20.cpp
Normal file
425
src/scenes/ship20/ship20.cpp
Normal file
@ -0,0 +1,425 @@
|
||||
#include "collada_types.hpp"
|
||||
|
||||
namespace ship20 {
|
||||
|
||||
using namespace collada;
|
||||
|
||||
light const light_environmentambientlight = {
|
||||
.type = light_type::AMBIENT,
|
||||
.color = { 0.0f, 0.0f, 0.0f },
|
||||
};
|
||||
|
||||
light const light_omni002_light = {
|
||||
.type = light_type::POINT,
|
||||
.color = { 1.0f, 1.0f, 1.0f },
|
||||
};
|
||||
|
||||
light const light_omni003_light = {
|
||||
.type = light_type::POINT,
|
||||
.color = { 1.0f, 1.0f, 1.0f },
|
||||
};
|
||||
|
||||
// shipple2_png
|
||||
image const image_shipple2_png = {
|
||||
.resource_name = L"_0_SHIPPLE2_PNG",
|
||||
};
|
||||
|
||||
image const * const images[] = {
|
||||
&image_shipple2_png,
|
||||
};
|
||||
|
||||
effect const effect_diffusetexture = {
|
||||
.type = effect_type::BLINN,
|
||||
.blinn = {
|
||||
.emission = {
|
||||
.type = color_or_texture_type::COLOR,
|
||||
.color = {0.0f, 0.0f, 0.0f, 1.0f},
|
||||
},
|
||||
.ambient = {
|
||||
.type = color_or_texture_type::COLOR,
|
||||
.color = {0.588f, 0.588f, 0.588f, 1.0f},
|
||||
},
|
||||
.diffuse = {
|
||||
.type = color_or_texture_type::TEXTURE,
|
||||
.texture = { .image_index = 0 }, // shipple2_png
|
||||
},
|
||||
.specular = {
|
||||
.type = color_or_texture_type::COLOR,
|
||||
.color = {0.5f, 0.5f, 0.5f, 1.0f},
|
||||
},
|
||||
.shininess = 10.0f,
|
||||
.reflective = {
|
||||
.type = color_or_texture_type::COLOR,
|
||||
.color = {0.0f, 0.0f, 0.0f, 1.0f},
|
||||
},
|
||||
.reflectivity = 0.0f,
|
||||
.transparent = {
|
||||
.type = color_or_texture_type::COLOR,
|
||||
.color = {1.0f, 1.0f, 1.0f, 1.0f},
|
||||
},
|
||||
.transparency = 1.0f,
|
||||
.index_of_refraction = 0.0f,
|
||||
}
|
||||
};
|
||||
|
||||
effect const effect_cyanengine = {
|
||||
.type = effect_type::BLINN,
|
||||
.blinn = {
|
||||
.emission = {
|
||||
.type = color_or_texture_type::COLOR,
|
||||
.color = {0.0f, 0.9647059f, 1.0f, 1.0f},
|
||||
},
|
||||
.ambient = {
|
||||
.type = color_or_texture_type::COLOR,
|
||||
.color = {0.0f, 0.0f, 0.0f, 1.0f},
|
||||
},
|
||||
.diffuse = {
|
||||
.type = color_or_texture_type::COLOR,
|
||||
.color = {0.0f, 0.0f, 0.0f, 1.0f},
|
||||
},
|
||||
.specular = {
|
||||
.type = color_or_texture_type::COLOR,
|
||||
.color = {0.0f, 0.0f, 0.0f, 1.0f},
|
||||
},
|
||||
.shininess = 10.0f,
|
||||
.reflective = {
|
||||
.type = color_or_texture_type::COLOR,
|
||||
.color = {0.0f, 0.0f, 0.0f, 1.0f},
|
||||
},
|
||||
.reflectivity = 0.0f,
|
||||
.transparent = {
|
||||
.type = color_or_texture_type::COLOR,
|
||||
.color = {1.0f, 1.0f, 1.0f, 1.0f},
|
||||
},
|
||||
.transparency = 1.0f,
|
||||
.index_of_refraction = 0.0f,
|
||||
}
|
||||
};
|
||||
|
||||
effect const effect_emissivetexture = {
|
||||
.type = effect_type::BLINN,
|
||||
.blinn = {
|
||||
.emission = {
|
||||
.type = color_or_texture_type::TEXTURE,
|
||||
.texture = { .image_index = 0 }, // shipple2_png
|
||||
},
|
||||
.ambient = {
|
||||
.type = color_or_texture_type::COLOR,
|
||||
.color = {0.588f, 0.588f, 0.588f, 1.0f},
|
||||
},
|
||||
.diffuse = {
|
||||
.type = color_or_texture_type::TEXTURE,
|
||||
.texture = { .image_index = 0 }, // shipple2_png
|
||||
},
|
||||
.specular = {
|
||||
.type = color_or_texture_type::COLOR,
|
||||
.color = {0.0f, 0.0f, 0.0f, 1.0f},
|
||||
},
|
||||
.shininess = 10.0f,
|
||||
.reflective = {
|
||||
.type = color_or_texture_type::COLOR,
|
||||
.color = {0.0f, 0.0f, 0.0f, 1.0f},
|
||||
},
|
||||
.reflectivity = 0.0f,
|
||||
.transparent = {
|
||||
.type = color_or_texture_type::COLOR,
|
||||
.color = {1.0f, 1.0f, 1.0f, 1.0f},
|
||||
},
|
||||
.transparency = 1.0f,
|
||||
.index_of_refraction = 0.0f,
|
||||
}
|
||||
};
|
||||
|
||||
material const material_diffusetexture_material = {
|
||||
.effect = &effect_diffusetexture,
|
||||
};
|
||||
|
||||
material const material_cyanengine_material = {
|
||||
.effect = &effect_cyanengine,
|
||||
};
|
||||
|
||||
material const material_emissivetexture_material = {
|
||||
.effect = &effect_emissivetexture,
|
||||
};
|
||||
|
||||
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_ship[] = {
|
||||
{
|
||||
.count = 2949, // triangles
|
||||
.index_offset = 0, // indices
|
||||
.inputs_index = 0, // index into inputs_list
|
||||
},
|
||||
{
|
||||
.count = 60, // triangles
|
||||
.index_offset = 8847, // indices
|
||||
.inputs_index = 0, // index into inputs_list
|
||||
},
|
||||
{
|
||||
.count = 239, // triangles
|
||||
.index_offset = 9027, // indices
|
||||
.inputs_index = 0, // index into inputs_list
|
||||
},
|
||||
};
|
||||
|
||||
geometry const geometry_geom_ship = {
|
||||
.mesh = {
|
||||
.triangles = triangles_geom_ship,
|
||||
.triangles_count = 3,
|
||||
|
||||
.vertex_buffer_offset = 0,
|
||||
.vertex_buffer_size = 133272,
|
||||
|
||||
.index_buffer_offset = 0,
|
||||
.index_buffer_size = 38976,
|
||||
}
|
||||
};
|
||||
|
||||
geometry const * const geometries[] = {
|
||||
&geometry_geom_ship,
|
||||
};
|
||||
|
||||
transform const transforms_node_environmentambientlight[] = {
|
||||
};
|
||||
|
||||
instance_geometry const instance_geometries_node_environmentambientlight[] = {
|
||||
};
|
||||
|
||||
instance_controller const instance_controllers_node_environmentambientlight[] = {
|
||||
};
|
||||
|
||||
instance_light const instance_lights_node_environmentambientlight[] = {
|
||||
{
|
||||
.light = &light_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,
|
||||
|
||||
.instance_controllers = instance_controllers_node_environmentambientlight,
|
||||
.instance_controllers_count = 0,
|
||||
|
||||
.instance_lights = instance_lights_node_environmentambientlight,
|
||||
.instance_lights_count = 1,
|
||||
|
||||
.channels = node_channels_node_environmentambientlight,
|
||||
.channels_count = 0,
|
||||
};
|
||||
|
||||
transform const transforms_node_ship[] = {
|
||||
{
|
||||
.type = transform_type::ROTATE,
|
||||
.rotate = {0.0f, 0.0f, 1.0f, -180.0f},
|
||||
},
|
||||
};
|
||||
|
||||
instance_material const instance_geometry_instance_materials_node_ship_0[] = {
|
||||
{
|
||||
.element_index = 2, // an index into mesh.triangles
|
||||
.material = &material_emissivetexture_material,
|
||||
|
||||
.emission = { .input_set = 0 },
|
||||
.ambient = { .input_set = -1 },
|
||||
.diffuse = { .input_set = 0 },
|
||||
.specular = { .input_set = -1 },
|
||||
},
|
||||
{
|
||||
.element_index = 0, // an index into mesh.triangles
|
||||
.material = &material_diffusetexture_material,
|
||||
|
||||
.emission = { .input_set = -1 },
|
||||
.ambient = { .input_set = -1 },
|
||||
.diffuse = { .input_set = 0 },
|
||||
.specular = { .input_set = -1 },
|
||||
},
|
||||
{
|
||||
.element_index = 1, // an index into mesh.triangles
|
||||
.material = &material_cyanengine_material,
|
||||
|
||||
.emission = { .input_set = -1 },
|
||||
.ambient = { .input_set = -1 },
|
||||
.diffuse = { .input_set = -1 },
|
||||
.specular = { .input_set = -1 },
|
||||
},
|
||||
};
|
||||
|
||||
instance_geometry const instance_geometries_node_ship[] = {
|
||||
{
|
||||
.geometry = &geometry_geom_ship,
|
||||
|
||||
.instance_materials = instance_geometry_instance_materials_node_ship_0,
|
||||
.instance_materials_count = 3,
|
||||
},
|
||||
};
|
||||
|
||||
instance_controller const instance_controllers_node_ship[] = {
|
||||
};
|
||||
|
||||
instance_light const instance_lights_node_ship[] = {
|
||||
};
|
||||
|
||||
channel const * const node_channels_node_ship[] = {
|
||||
};
|
||||
|
||||
node const node_node_ship = {
|
||||
.parent_index = -1,
|
||||
|
||||
.type = node_type::NODE,
|
||||
|
||||
.transforms = transforms_node_ship,
|
||||
.transforms_count = 1,
|
||||
|
||||
.instance_geometries = instance_geometries_node_ship,
|
||||
.instance_geometries_count = 1,
|
||||
|
||||
.instance_controllers = instance_controllers_node_ship,
|
||||
.instance_controllers_count = 0,
|
||||
|
||||
.instance_lights = instance_lights_node_ship,
|
||||
.instance_lights_count = 0,
|
||||
|
||||
.channels = node_channels_node_ship,
|
||||
.channels_count = 0,
|
||||
};
|
||||
|
||||
transform const transforms_node_omni002[] = {
|
||||
{
|
||||
.type = transform_type::TRANSLATE,
|
||||
.translate = {-286.5521f, 395.7583f, 161.5579f},
|
||||
},
|
||||
};
|
||||
|
||||
instance_geometry const instance_geometries_node_omni002[] = {
|
||||
};
|
||||
|
||||
instance_controller const instance_controllers_node_omni002[] = {
|
||||
};
|
||||
|
||||
instance_light const instance_lights_node_omni002[] = {
|
||||
{
|
||||
.light = &light_omni002_light,
|
||||
}
|
||||
};
|
||||
|
||||
channel const * const node_channels_node_omni002[] = {
|
||||
};
|
||||
|
||||
node const node_node_omni002 = {
|
||||
.parent_index = -1,
|
||||
|
||||
.type = node_type::NODE,
|
||||
|
||||
.transforms = transforms_node_omni002,
|
||||
.transforms_count = 1,
|
||||
|
||||
.instance_geometries = instance_geometries_node_omni002,
|
||||
.instance_geometries_count = 0,
|
||||
|
||||
.instance_controllers = instance_controllers_node_omni002,
|
||||
.instance_controllers_count = 0,
|
||||
|
||||
.instance_lights = instance_lights_node_omni002,
|
||||
.instance_lights_count = 1,
|
||||
|
||||
.channels = node_channels_node_omni002,
|
||||
.channels_count = 0,
|
||||
};
|
||||
|
||||
transform const transforms_node_omni003[] = {
|
||||
{
|
||||
.type = transform_type::TRANSLATE,
|
||||
.translate = {333.2103f, -314.4593f, 161.5578f},
|
||||
},
|
||||
};
|
||||
|
||||
instance_geometry const instance_geometries_node_omni003[] = {
|
||||
};
|
||||
|
||||
instance_controller const instance_controllers_node_omni003[] = {
|
||||
};
|
||||
|
||||
instance_light const instance_lights_node_omni003[] = {
|
||||
{
|
||||
.light = &light_omni003_light,
|
||||
}
|
||||
};
|
||||
|
||||
channel const * const node_channels_node_omni003[] = {
|
||||
};
|
||||
|
||||
node const node_node_omni003 = {
|
||||
.parent_index = -1,
|
||||
|
||||
.type = node_type::NODE,
|
||||
|
||||
.transforms = transforms_node_omni003,
|
||||
.transforms_count = 1,
|
||||
|
||||
.instance_geometries = instance_geometries_node_omni003,
|
||||
.instance_geometries_count = 0,
|
||||
|
||||
.instance_controllers = instance_controllers_node_omni003,
|
||||
.instance_controllers_count = 0,
|
||||
|
||||
.instance_lights = instance_lights_node_omni003,
|
||||
.instance_lights_count = 1,
|
||||
|
||||
.channels = node_channels_node_omni003,
|
||||
.channels_count = 0,
|
||||
};
|
||||
|
||||
node const * const nodes[] = {
|
||||
&node_node_environmentambientlight, // 0
|
||||
&node_node_ship, // 1
|
||||
&node_node_omni002, // 2
|
||||
&node_node_omni003, // 3
|
||||
};
|
||||
|
||||
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])),
|
||||
|
||||
.images = images,
|
||||
.images_count = (sizeof (images)) / (sizeof (images[0])),
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user