我的目的:-显示重叠区域与整个左右卫星或航空图像
- rotate image using roll, pitch yaw angles
-image format is Tiff image现在我正在对航空立体图像(左,右立体对)进行OpengGL 3d立体查看。我使用以下代码显示了我的左、右图像:
glDrawBuffer (GL_BACK_LEFT);
LeftBuf = new unsigned char [LeftCol * LeftRow *3];
for (int i = 0; i < LeftRow; i++){
for (int j = 0; j< LeftCol; j++){
LeftBuf [(i*LeftCol + j)*3] = tiff.LnBuf [i*LeftCol + LeftCol-(j-1)];
LeftBuf [(i*LeftCol + j)*3+1] = tiff.LnBuf [i*LeftCol + LeftCol-(j-1)];
LeftBuf [(i*LeftCol + j)*3+2] = tiff.LnBuf [i*LeftCol + LeftCol-(j-1)];
}
}
glRasterPos2f(-1,-1);
glDrawPixels(LeftCol, LeftRow, GL_RGB, GL_UNSIGNED_BYTE, LeftBuf);
glDrawBuffer (GL_BACK_RIGHT);
RightBuf = new unsigned char [RightCol *RightRow *3];
for (int r = 0; r < RightRow; r++){
for (int c = 0; c< RightCol; c++){
RightBuf [(r*RightCol + c)*3] = tiff.RnBuf [r*RightCol + RightCol-(c-1)];
RightBuf [(r*RightCol + c)*3+1] = tiff.RnBuf [r*RightCol + RightCol-(c-1)];
RightBuf [(r*RightCol + c)*3+2] = tiff.RnBuf [r*RightCol + RightCol-(c-1)];
}
}
glRasterPos2f(-1,-0.45);
glDrawPixels(RightCol, RightRow, GL_RGB, GL_UNSIGNED_BYTE, RightBuf);现在我需要使用Opengl的以下函数来3D旋转我的右侧图像: glRotatef(rightphoto.omega*180/PI,1.0f,0.0f,0.0f);glRotatef(rightphoto.phi*180/PI,0.0f,1.0f,0.0f);glRotatef(rightphoto.kappa*180/PI,0.0f,0.0f,1.0f);,但我不能旋转我的图像。
请帮助我如何旋转我的图像!此外,我想要显示左重叠的整个图像的同一部分的左,右图像与3d旋转。我不知道如何计算整个左右图像的重叠区域坐标。对不起,我的英语很差。
发布于 2008-11-27 08:36:26
使用glDrawPixels()读取或写入的像素不会被模型视图矩阵转换,而这正是glRotatef()所更改的。它们是像素,比实际模型更底层的原语。
要解决此问题,请考虑使用纹理映射基本体(如四边形)绘制内容。
https://stackoverflow.com/questions/323053
复制相似问题