内容导航:
1、
yaw angle
2、
opengl中 gllookat参数可以为变量吗
1、
yaw angle
英:
美:
常见释义:
【航】偏航角
1、Analysis of Requirement to the Yaw Angle Error in Stripmap SAR Imaging───条带SAR成像对偏航角最大误差要求的理论分析
2、This article focuses on the drift probability distribution model due to the
yaw angle
.───本文重点讨论偏航角导致的漂移量分布概率。
3、and 3. measuring an elevation angle and a
yaw angle
of an optical path of the probe and detecting the installation angle of the probe.───测量探头光路的仰角和偏航角,进行探头安装角度的检测。
4、This article focuses on the drift probability distribution model due to the yaw Angle.───本文重点讨论偏航角导致的漂移量分布概率。
5、Analysis of Trains Aerodynamic Performance with Different Yaw Angle and Ground Condition───不同风向角和地面条件下的列车空气动力性能分析
6、The results show that this type of inlet has high total pressure recovery coefficients at a wide range of
yaw angle
.───研究表明,该类进气道在各种侧滑状态下总压恢复系数较高。
7、But the regions of local flow separation and distortion factor of the flow at the exit section are relevant closely to the
yaw angle
.───但是进气道内气流分离的区域和出口截面流场畸变指数却与侧滑角的大小密切相关。
1、healing angle───愈合角
2、repose angle───静止角;安定角;休止角
3、angle───n.角,角度;视角;立场;角铁;(古)鱼钩;v.斜移;从……角度提供信息;钓鱼;谋取
4、intercepted angle───截获角
5、angle baby───天使宝宝
6、face angle───齿面角;【数】面角
7、yaw system───调向系统
8、proverse yaw───proverse偏航
9、azimuthal angle───【计】 方位角;【测】方位角
2、
opengl中 gllookat参数可以为变量吗
可以啊,通过设置相机移动,对gllookat中的参数进行修改。这有个相机类。
#ifndef __CAMERA_H__
#define __CAMERA_H__
#include "Vector.h"
#include "stdafx.h"
/**< 包含向量类头文件 */
/** 摄像机类 */
class Camera
{
public:
/** 构造函数和析构函数 */
Camera();
~Camera();
/** 获得摄像机状态方法 */
Vector3 getPosition() { return m_Position; }
Vector3 getView() { return m_View; }
Vector3 getUpVector() { return m_UpVector; }
float getSpeed() { return m_Speed; }
/** 设置速度 */
void setSpeed(float speed)
{
m_Speed = speed;
}
/** 设置摄像机的位置, 观察点和向上向量 */
void setCamera(float positionX, float positionY, float positionZ,
float viewX, float viewY, float viewZ,
float upVectorX, float upVectorY, float upVectorZ);
/** 旋转摄像机方向 */
void rotateView(float angle, float X, float Y, float Z);
/** 根据鼠标设置摄像机观察方向 */
void setViewByMouse(POINT mypoint1,POINT mypoint2);
/** 左右摄像机移动 */
void yawCamera(float speed);
/** 前后移动摄像机 */
void moveCamera(float speed);
/** 放置摄像机 */
void setLook();
private:
/** 摄像机属性 */
Vector3 m_Position; /**< 位置 */
Vector3 m_View; /**< 朝向 */
Vector3 m_UpVector; /**< 向上向量 */
float m_Speed; /**< 速度 */
};
#endif //__CAMERA_H__
#include "Camera.h" /**< 包含摄像机头文件 */
#include "Vector.h" /**< 包含向量类 */
/** 构造函数 */
Camera::Camera()
{
/** 初始化向量值 */
Vector3 zero = Vector3(0.0, 0.0, 0.0);
Vector3 view = Vector3(0.0, 1.0, 0.5);
Vector3 up = Vector3(0.0, 0.0, 1.0);
/** 初始化摄像机 */
m_Position = zero;
m_View = view;
m_UpVector = up;
m_Speed = 0.2f;
}
Camera::~Camera()
{
}
/** 设置摄像机的位置,朝向和向上向量 */
void Camera::setCamera( float positionX, float positionY, float positionZ,
float viewX, float viewY, float viewZ,
float upVectorX, float upVectorY, float upVectorZ)
{
/** 构造向量 */
Vector3 Position = Vector3(positionX, positionY, positionZ);
Vector3 View = Vector3(viewX, viewY, viewZ);
Vector3 UpVector = Vector3(upVectorX, upVectorY, upVectorZ);
/** 设置摄像机 */
m_Position = Position;
m_View = View;
m_UpVector = UpVector;
}
/** 旋转摄像机方向 */
void Camera::rotateView(float angle, float x, float y, float z)
{
Vector3 newView;
/** 计算方向向量 */
Vector3 view = m_View - m_Position;
/** 计算 sin 和cos值 */
float cosTheta = (float)cos(angle);
float sinTheta = (float)sin(angle);
/** 计算旋转向量的x值 */
newView.x = (cosTheta + (1 - cosTheta) * x * x) * view.x;
newView.x += ((1 - cosTheta) * x * y - z * sinTheta) * view.y;
newView.x += ((1 - cosTheta) * x * z + y * sinTheta) * view.z;
/** 计算旋转向量的y值 */
newView.y = ((1 - cosTheta) * x * y + z * sinTheta) * view.x;
newView.y += (cosTheta + (1 - cosTheta) * y * y) * view.y;
newView.y += ((1 - cosTheta) * y * z - x * sinTheta) * view.z;
/** 计算旋转向量的z值 */
newView.z = ((1 - cosTheta) * x * z - y * sinTheta) * view.x;
newView.z += ((1 - cosTheta) * y * z + x * sinTheta) * view.y;
newView.z += (cosTheta + (1 - cosTheta) * z * z) * view.z;
/** 更新摄像机的方向 */
m_View = m_Position + newView;
}
/** 用鼠标旋转摄像机 */
void Camera::setViewByMouse(POINT mpoint1,POINT mpoint2)
{
/* POINT mousePos; */ /**< 保存当前鼠标位置 */
int middleX = GetSystemMetrics(SM_CXSCREEN) >> 1; /**< 得到屏幕宽度的一半 */
int middleY = GetSystemMetrics(SM_CYSCREEN) >> 1; /**< 得到屏幕高度的一半 */
float angleY = 0.0f; /**< 摄像机左右旋转角度 */
float angleZ = 0.0f; /**< 摄像机上下旋转角度 */
static float currentRotX = 0.0f;
/** 得到当前鼠标位置 */
/* GetCursorPos(&mousePos); */
ShowCursor(TRUE);
///** 如果鼠标没有移动,则不用更新 */
//if( (mousePos.x == middleX) && (mousePos.y == middleY) )
// return;
///** 设置鼠标位置在屏幕中心 */
//SetCursorPos(middleX, middleY);
/**< 得到鼠标移动方向 */
angleY = (float)( (mpoint2.x - mpoint1.x) ) / 14000.0f;
angleZ = (float)( (mpoint2.y - mpoint1.y) ) / 14000.0f;
static float lastRotX = 0.0f; /**< 用于保存旋转角度 */
lastRotX = currentRotX;
/** 跟踪摄像机上下旋转角度 */
currentRotX += angleZ;
/** 如果上下旋转弧度大于1.0,我们截取到1.0并旋转 */
if(currentRotX > 1.0f)
{
currentRotX = 1.0f;
/** 根据保存的角度旋转方向 */
if(lastRotX != 1.0f)
{
/** 通过叉积找到与旋转方向垂直的向量 */
Vector3 vAxis = m_View - m_Position;
vAxis = vAxis.crossProduct(m_UpVector);
vAxis = vAxis.normalize();
///旋转
rotateView( 1.0f - lastRotX, vAxis.x, vAxis.y, vAxis.z);
}
}
/** 如果旋转弧度小于-1.0,则也截取到-1.0并旋转 */
else if(currentRotX < -1.0f)
{
currentRotX = -1.0f;
if(lastRotX != -1.0f)
{
/** 通过叉积找到与旋转方向垂直的向量 */
Vector3 vAxis = m_View - m_Position;
vAxis = vAxis.crossProduct(m_UpVector);
vAxis = vAxis.normalize();
///旋转
rotateView( -1.0f - lastRotX, vAxis.x, vAxis.y, vAxis.z);
}
}
/** 否则就旋转angleZ度 */
else
{
/** 找到与旋转方向垂直向量 */
Vector3 vAxis = m_View - m_Position;
vAxis = vAxis.crossProduct(m_UpVector);
vAxis = vAxis.normalize();
///旋转
rotateView(angleZ, vAxis.x, vAxis.y, vAxis.z);
}
/** 总是左右旋转摄像机 */
rotateView(angleY, 0, 1, 0);
}
/** 左右移动摄像机 */
void Camera::yawCamera(float speed)
{
Vector3 yaw;
Vector3 cross = m_View - m_Position;
cross = cross.crossProduct(m_UpVector);
// Normalize the strafe vector
yaw = cross.normalize();
m_Position.x += yaw.x * speed;
m_Position.z += yaw.z * speed;
// Add the strafe vector to our view
m_View.x += yaw.x * speed;
m_View.z += yaw.z * speed;
}
/** 前后移动摄像机 */
void Camera::moveCamera(float speed)
{
/** 计算方向向量 */
Vector3 vector = m_View - m_Position;
vector = vector.normalize(); /**< 单位化 */
/** 更新摄像机 */
m_Position.x += vector.x * speed; /**< 根据速度更新位置 */
m_Position.z += vector.z * speed;
m_View.x += vector.x * speed; /**< 根据速度更新方向 */
m_View.z += vector.z * speed;
}
/** 设置视点 */
void Camera::setLook()
{
/** 设置视口 */
gluLookAt(m_Position.x, m_Position.y, m_Position.z,
m_View.x, m_View.y, m_View.z,
m_UpVector.x, m_UpVector.y, m_UpVector.z);
}