# 2026/09/19: 台座付き結晶。モデル内の形状と階層を保存するModelYAML
# versionはModelAssetで文字列として扱う
type: webg-model-asset
version: "1.0"
meta:
  name: Crystal on a pedestal
materials:
  - id: crystal
    shaderParams:
      color: [0.12, 0.72, 0.95, 1]
      use_texture: 0
      has_bone: 0
      ambient: 0.3
      specular: 0.8
      power: 48
      flat_shading: 1
  - id: pedestal
    shaderParams:
      color: [0.95, 0.55, 0.18, 1]
      use_texture: 0
      has_bone: 0
      ambient: 0.3
      specular: 0.5
      power: 24
meshes:
  # 上下の先端と四つの中間頂点からなる八面体
  - id: crystal-mesh
    material: crystal
    geometry:
      vertexCount: 6
      polygonCount: 8
      positions: [0, 1.2, 0, 0, -0.6, 0, -0.65, 0, 0, 0, 0, 0.65, 0.65, 0, 0, 0, 0, -0.65]
      indices: [0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 2, 1, 3, 2, 1, 4, 3, 1, 5, 4, 1, 2, 5]
  # 台座の寸法はgeometryに記録する
  - id: pedestal-mesh
    material: pedestal
    geometry:
      vertexCount: 8
      polygonCount: 12
      positions: [-0.9, 0, -0.9, 0.9, 0, -0.9, 0.9, 0.3, -0.9, -0.9, 0.3, -0.9, -0.9, 0, 0.9, 0.9, 0, 0.9, 0.9, 0.3, 0.9, -0.9, 0.3, 0.9]
      indices: [0, 2, 1, 0, 3, 2, 4, 5, 6, 4, 6, 7, 0, 4, 7, 0, 7, 3, 1, 2, 6, 1, 6, 5, 3, 7, 6, 3, 6, 2, 0, 1, 5, 0, 5, 4]
nodes:
  # rootを移動すると、子の台座と結晶が一緒に移動する
  - id: root
    name: root
    parent: null
    transform:
      translation: [0, 0, 0]
      rotation: [0, 0, 0, 1]
      scale: [1, 1, 1]
  - id: base
    name: base
    parent: root
    mesh: pedestal-mesh
    transform:
      translation: [0, 0, 0]
      rotation: [0, 0, 0, 1]
      scale: [1, 1, 1]
  - id: gem
    name: gem
    parent: root
    mesh: crystal-mesh
    transform:
      translation: [0, 0.95, 0]
      rotation: [0, 0, 0, 1]
      scale: [1, 1, 1]
