web3d — 卧室场景

三维网站 everyinch 5127℃ 0评论

house

效果演示

左右键水平方向转动,上下键垂直方向转动

旋转摄像机的代码是

var dt = Time.deltaTime;
x -= Input.GetAxis(“Horizontal”) * horizontalSpeed * dt;
y += Input.GetAxis(“Vertical”) * verticalSpeed * dt;

y = ClampAngle(y, minVertical, maxVertical);

var rotation = Quaternion.Euler(y, x, 0);
var position = rotation * Vector3(0.0, 0.0, -distance) + target.position;

transform.rotation = rotation;
transform.position = position;

分享&收藏

转载请注明:陈童的博客 » web3d — 卧室场景

喜欢 (0)
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(1)个小伙伴在吐槽
  1. so cool!
    小巷里的女孩2014-01-10 08:16 回复
'; } if( dopt('d_footcode_b') ) echo dopt('d_footcode'); ?>