Wednesday, July 30, 2008
AE / ae3dConvertToScreen 2
ae3dconverttoscreen から続く
立方体のワイアフレームを、4つのひと筆書きのポリゴンで作ると、線だけの透明な立方体では問題ないですが、グラフィックをオペークにして、面に色を付けたりすると、右図1のように閉じられていないポイントに、線が入ってしまいます。これを避けるには、立方体の6面を単位としたグループで、ポリゴンを構成するのが良いようです。
図3のポイントリストで、立体の面に色を付ける
on mouseUp
repeat for each line theLine in field "tPoints"
if theLine = "" then
put return after output
next repeat
end if
put ae3dconverttoscreen(theLine,the loc of this cd,300) & return after output
end repeat
set the points of graphic "threeD" to char 1 to -2 of output
set the foregroundcolor of grc "threeD" to 179,179,179
set the backgroundcolor of grc "threeD" to 230,230,230
set the opaque of grc "threeD" to true
end mouseUp
しかし、とすると? Z軸のプラスマイナスは逆向きかもしれない? と思ったけれど、
オペークの面が向こう側の線を、見えなくはしていないようで、
面に色を付けても、やはりすべての線が表示されます。
始めにAnimation Engineを開いて、start using stack "animationEngine"
サンプルスタックは、下記をメッセージボックスにコピペしてリターンキーを
go stack \
url "http://homepage.mac.com/kenjikojima/jrevnote/ae3dconverttoscreen.rev"
a
b
g
e
a
a
e
f
d
a
a
b
c
d
a
h
f
e
g
h
h
f
d
c
h
h
c
b
g
h
50,50,50
50,-50,50
50,-50,-50
50,50,-50
50,50,50
50,50,50
50,50,-50
-50,50,-50
-50,50,50
50,50,50
50,50,50
50,-50,50
-50,-50,50
-50,50,50
50,50,50
-50,-50,-50
-50,50,-50
50,50,-50
50,-50,-50
-50,-50,-50
-50,-50,-50
-50,50,-50
-50,50,50
-50,-50,50
-50,-50,-50
-50,-50,-50
-50,-50,50
50,-50,50
50,-50,-50
-50,-50,-50