サイトTopへ
Pサンプル 割れたワイングラス (2005年8月29日更新)
図形の半自動分割機能を利用して、一部を細かく分割すれば簡単に作れます。

1. PのOpenGL表示とモデルビューウィンドウ ・・・・データファイル   BrokenWineGlass01.Pin




2. 3D AVS Player で表示 ・・・・ データファイル  BrokenWineGlass01.mgf

 シェーディング時に、再分割したセルと隣のセルとの間で、光の反射方向を決める法線補間の段差が生じでしまい、明るさの段差が生じ、少し不自然になってしまっています。  明るさの段差は隣のセルとの中間ノードが多くあるためです。  




BrokenWineGlass01.Pin のリスト
group 1 pnt
  node 1 xyz 0.01
group 2 line
  select group 0 node 1
    $grpnum off
    $cellnum off
  expand dxyz 5   0 0
  expand dxyz 0   0.2 0
  expand dxyz -4.7 0.4 0
  expand dxyz 0   10 0
  expand dxyz 1 0.4 0
  expand dxyz 1 0.5 0
  expand dxyz 1 0.7 0
  expand dxyz 1 1 0
  expand dxyz 1 2 0
  expand dxyz 1 3 0
group 3 quad
  axis x z y
  select group 2
  expand draz 0 30::12 0
    $cellnum group off
    $nodenum group off
    $nodenum off
    $a
  merge all
  name MGF group 3
group 4 tri
  select group 0 cell 50
  div n  5 5 1 0.8 0.8
    $node on
  select group 0 cell 60 face 1
  div n  5 5 1 0.8 1.2 1 2
  select group 0 cell 176
  select group 0 cell 50
  delete
  select group 0 cell 129
  select group 0 cell 167
  release all
  select group 0 cell 178
  select group 0 cell 179
  delete
  select group 0 cell 180
  select group 0 cell 221
  select group 0 cell 60
  delete
  select group 0 cell 169
  select group 0 cell 168
  select group 0 cell 167
  delete
  select group 0 cell 166
  select group 0 cell 160
  select group 0 cell 165
  delete
  select group 0 cell 222
  select group 0 cell 223
  select group 0 cell 212
  select group 0 cell 211
  delete
  select group 0 cell 170
  select group 0 cell 159
  delete
  select group 0 cell 201
  select group 0 cell 149
  delete
  select group 0 cell 157
  delete
  select group 0 cell 155
  delete
  select group 0 cell 227
  select group 0 cell 226
  select group 0 cell 215
  select group 0 cell 225
  select group 0 cell 177
  delete
  select group 0 cell 164
  select group 0 cell 153
  select group 0 cell 154
  select group 0 cell 152
  select group 0 cell 143
  select group 0 cell 142
  delete
  select group 0 cell 229
  select group 0 cell 219
  select group 0 cell 230
  delete
  select group 0 cell 224
  select group 0 cell 213
  delete
  select group 0 cell 220
  select group 0 cell 209
  select group 0 cell 208
  delete
    $node off
  name MGF group 4
  merge all

サイトTopへ