various stuff in opengl demos such as a better model,

stable trackball for the fly navigation mode, and started
to put some GUI elements...
This commit is contained in:
Gael Guennebaud
2008-09-09 18:50:45 +00:00
parent d3a70b7fac
commit 146c9e4494
11 changed files with 530 additions and 142 deletions

View File

@@ -42,8 +42,7 @@ Camera::Camera()
mVpX = 0;
mVpY = 0;
setPosition(Vector3f::Constant(50.));
setPosition(Vector3f::Constant(100.));
setTarget(Vector3f::Zero());
}
@@ -179,6 +178,14 @@ void Camera::rotateAroundTarget(const Quaternionf& q)
mViewIsUptodate = true;
}
void Camera::localRotate(const Quaternionf& q)
{
float dist = (position() - mTarget).norm();
setOrientation(orientation() * q);
mTarget = position() + dist * direction();
mViewIsUptodate = false;
}
void Camera::zoom(float d)
{
float dist = (position() - mTarget).norm();