入門7:カメラ

Last-modified: 2010-09-10 (金) 21:58:58

カメラ

3Dを表示するためにカメラを設置する。

autocam off
モデルの配置
カメラの配置
カメラの方向
画面の設定

以上でカメラ内容が画面に表示される。

例えばですね、
あなたが、テープルの上に人形を置いて カメラで撮影したとする。
人形の位置を決めます。position object
カメラの位置を決めます、手で持つのかな。position camera
カメラの方向を決めます、人形の方向ですね。point camera
照明も必要ですが、初期設定でもオーケーです。
これで人形の撮影ができます、3Dも同じ様に考えて行います。

※autocam offは、オートをやめて、手動で設定します。

rem Camera test
set display mode 640,480,32
autocam off
backdrop on
make matrix 1, 100,100,10,10
make object cube 1,10
POSITION OBJECT 1, 50,0,50
position camera 0,0,100,0
point camera 0,40,0,40
set camera view 0,0,0,320,240
do
	sync
loop
rem マルチカメラ テスト
set display mode 640,480,32
autocam off
backdrop on
make matrix 1, 100,100,10,10
make object cube 1,10
POSITION OBJECT 1, 50,0,50
position camera 0,0,100,0
point camera 0,40,0,40
set camera view 0,0,0,320,240
make camera 1
position camera 1,0,10,0
point camera 1,40,0,40
set camera view 1,320,0,640,240
do
	sync
loop
Rem  TPS CAMERA : set camera to follow
autocam off
make matrix 1,4000,4000,100,100
set matrix height 1,50,50,500
update matrix 1
make object box 1, 10,20,30
sync on : sync rate 60
while mouseclick()<>1
    if upkey()=1    then move object 1,4
    if downkey()=1  then move object 1,-4
    if leftkey()=1  then ya#=ya#-2
    if rightkey()=1 then ya#=ya#+2
    if shiftkey()=1   then an#=an#+1
    if controlkey()=1 then an#=an#-1
    rotate object 1, 0,ya#,0
    x#=object position x(1)
    y#=object position y(1)
    z#=object position z(1)
    angle#=object angle y(1)+an#
    distance#=200.0
    height#=100.0
    smooth#=12.0
    set camera to follow x#,y#,z#,angle#,distance#,height#,smooth#,0
    sync
endwhile
end

なにかあればどうぞ

  • (^^; 説明を・・・・・・・・。 -- ゲーム屋? 2010-08-17 (火) 09:39:11
  • (--; わかりやすく -- 2010-08-17 (火) 09:40:18
  • (^^) なるほど -- 2010-08-17 (火) 09:40:43
  • 詳しいですね -- 2010-08-17 (火) 09:41:08
  • (^^; 全くわかりません -- 2010-08-17 (火) 09:42:02