UNITY3D 相機(jī)特寫鏡頭的方位設(shè)置
2019/6/13??????點(diǎn)擊:
UNITY3D 相機(jī)特寫鏡頭的方位設(shè)置
public void LookatModel() { targetVector3 = model.position + model.right * 5;//設(shè)置相機(jī)的位置在模型的右側(cè)5單位遠(yuǎn)處 Vector3 dir = model.position - targetVector3; //獲取攝像機(jī)的朝向 transform.DOMove(targetVector3,2f); Quaternion q = Quaternion.LookRotation(dir); //將朝向轉(zhuǎn)換成四元數(shù) targetEuler = q.eulerAngles; //四元數(shù)轉(zhuǎn)換成歐拉角 transform.DORotate(targetEuler, 2,RotateMode.Fast) ; }
- 上一篇:在虛擬裝配應(yīng)用中,用數(shù)據(jù)手套實(shí)現(xiàn)擰螺絲動作 2019/6/16
- 下一篇:UNITY3D繪制可調(diào)整行列數(shù)的網(wǎng)格 2019/6/12