之前做的,幫它加了牙齒跟骨骼
想做很久的沙漠之鷹
Mini Cooper
川崎Ninja250R
UH-1D
檔車的王道 - 野狼125
Normal Map Test
很快的暑假過了一半,放上這個月做的模型,學了NormalMap,不應該用Box,要導個圓角會更好,利用Unity做了個展示功能的程式,把做的車子匯入做旋轉,下面是連結。
//---------------------------------------------------------------------------
#include
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//全域變數(num中獎的號碼),(pos代表LED燈位置),(sel控制移動速度)
int num,pos = 1,sel;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
//點擊開始按鈕
void __fastcall TForm1::bGoClick(TObject *Sender)
{
srand((unsigned)time(NULL)); //取得系統時間作為亂數種子
Timer1->Enabled = true; //開啟計時器1
Timer1->Interval = 100; //設定計時器執行時間
num=rand()%14; //取亂數
num += 56; //將取得的亂數加56,可多繞4圈
sel = num;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
sel--;
if(sel<6) //判斷sel小於6增加計時器執行時間為500(0.5秒執行一次)
Timer1->Interval = 500;
if(sel<3) //判斷sel小於3增加計時器執行時間為1000(1秒執行一次)
Timer1->Interval = 1000;
if(sel==0) //判斷sel等於0關閉計時器
{
Timer1->Enabled = false;
}
pos++; //移動位置加1,等於15(即繞完一圈)回到1
if(pos==15)
pos=1;
switch(pos) //依照pos移動到指定的位置
{
case 1:
bw->Left = 64;
bw->Top = 16;
break;
case 2:
bw->Left = 112;
bw->Top = 16;
break;
case 3:
bw->Left = 160;
bw->Top = 16;
break;
case 4:
bw->Left = 208;
bw->Top = 16;
break;
case 5:
bw->Left = 208;
bw->Top = 64;
break;
case 6:
bw->Left = 208;
bw->Top = 112;
break;
case 7:
bw->Left = 208;
bw->Top = 160;
break;
case 8:
bw->Left = 160;
bw->Top = 160;
break;
case 9:
bw->Left = 112;
bw->Top = 160;
break;
case 10:
bw->Left = 64;
bw->Top = 160;
break;
case 11:
bw->Left = 16;
bw->Top = 160;
break;
case 12:
bw->Left = 16;
bw->Top = 112;
break;
case 13:
bw->Left = 16;
bw->Top = 64;
break;
case 14:
bw->Left = 16;
bw->Top = 16;
break;
}
} |