POV-Ray: モデル座標系


要素の回転中心を原点とするモデル座標系を考えて、 それらを組み合せることで関節の変形が可能な構造を作ることができる。
モデル座標系の階層構造
手の平
回転中心を原点に平行移動
手首関節回りの回転
平行移動 <0,下腕の長さ,0>
下腕 回転中心を原点に平行移動 肘関節回りの回転 平行移動 <0,上腕の長さ,0>
上腕 回転中心を原点に平行移動 肩関節回りの回転

Union をモデル座標系の内包に使う


multiCoord.pov
#include "colors.inc"
#include "shapes.inc"
#include "stones.inc"

camera {
  location <60,70,0>
  look_at <0,0,0>
  angle 20
}

light_source { <0,10,-10> color White }

union {
  union {
    object { // 手の平
      Sphere
      texture { T_Stone13 }
      translate <0, 1, 0>

      rotate <20, 0, 0>    // 手首関節回りの回転

      translate <0, 4, 0>
    }
    object { // 下腕
      Sphere
      texture { T_Stone12 }
      scale <1,2,1>
      translate <0, 2, 0>
    } 

    rotate <20, 0, 0>       // 肘関節回りの回転

    translate <0,6,0>
  }

  object { // 上腕
    Sphere
    texture { T_Stone14 }
    scale <1,3,1>
    translate <0, 3, 0>
  }

  rotate <10, 0, 0>           // 肩関節回りの回転

}