有人可以帮我创建一个这样的相机:http://www.youtube.com/watch?v=8fIoxtJ_FK4&feature=youtu.be&t=1m24s
我知道,他们是用陀螺仪做的。但是,我不知道他们是怎么处理摄像机的
非常感谢!
发布于 2013-11-11 16:45:10
你可以使用陀螺仪的旋转速度或姿态。只需根据陀螺更新相机的旋转即可。下面是一个如何做到这一点的示例代码。
void Start() 
{
    Input.gyro.enabled = true;
}
void Update() 
{
    rotationRate = Input.gyro.rotationRateUnbiased;
    angle.x += -rotationRate.x * ROTATION_SPEED;
    angle.y += -rotationRate.y * ROTATION_SPEED;
    Camera.main.transform.localEulerAngles = angle;
}文档可以在以下位置找到:http://docs.unity3d.com/Documentation/ScriptReference/Gyroscope.html
https://stackoverflow.com/questions/19782627
复制相似问题