UNITY3D 相機特寫鏡頭的方位設(shè)置
2019/6/13??????點擊:
UNITY3D 相機特寫鏡頭的方位設(shè)置
public void LookatModel() { targetVector3 = model.position + model.right * 5;//設(shè)置相機的位置在模型的右側(cè)5單位遠處 Vector3 dir = model.position - targetVector3; //獲取攝像機的朝向 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ù)手套實現(xiàn)擰螺絲動作 2019/6/16
- 下一篇:UNITY3D繪制可調(diào)整行列數(shù)的網(wǎng)格 2019/6/12