定義
Extrusion {
eventIn MFVec2f set_crossSection
eventIn MFRotation set_orientation
eventIn MFVec2f set_scale
eventIn MFVec3f set_spine
field SFBool beginCap TRUE
field SFBool ccw TRUE
field SFBool convex TRUE
field SFFloat creaseAngle 0 # [0,)
field MFVec2f crossSection [ 1 1, 1 -1, -1 -1,
-1 1, 1 1 ] # (-,)
field SFBool endCap TRUE
field MFRotation orientation 0 0 1 0 # [-1,1],(-,)
field MFVec2f scale 1 1 # (0,)
field SFBool solid TRUE
field MFVec3f spine [ 0 0 0, 0 1 0 ] # (-,)
}
2次元の断面を3次元の経路(背骨)に沿って動かした場合に出来る形を作ります。
- set_crossSection
- 後述のcrossSectionを設定するためのイベント
- set_orientation
- 後述のorientationを設定するためのイベント
- set_scale
- 後述のscaleを設定するためのイベント
- set_spine
- 後述のspineを設定するためのイベント
- beginCap
- 経路の最初の端のへ面を描画するかどうか
- ccw
- solidが偽なら外部から真なら内部から見えなくなる
- convex
- 物体が凸かどうか
- creaseAngle
- 二つの面が接するときその角度がここに指定されたもの以下
の場合、 その辺での法線が滑らかに変化するようになります。
- crossSection
- 物体の断面の形
- endCap
- 経路の最初の端のへ面を描画するかどうか
- orientation
- 断面と経路がなす角度
- scale
- 断面に適用するスケール
- solid
- 視点が外部と内部の両方の場合に見えるかどうか
- spine
- 断面を動かす経路(背骨)
厳密にいうと曲がり角等でどのような形になるか決まっているのですが、
詳細は大元のリファレンスを参照して下さい。
サンプル
三角の断面を持つZ型の物体です
#VRML V2.0 utf8
Shape {
geometry Extrusion {
crossSection [ .5 .5, .5 0, 0 .5, .5 .5]
spine [1 -2 0, -1 -2 0, 1 2 0, -1 2 0]
}
}