Fixed axis orientation

This commit is contained in:
Paolo Cignoni cignoni 2010-11-13 17:09:06 +00:00
parent 5a99a148a0
commit 511a6ec4f2
2 changed files with 8 additions and 4 deletions

View File

@ -27,7 +27,7 @@
Point3f CameraParameters::getTranslation()
{
return Point3f(_fields[CameraParameters::POS_X], _fields[CameraParameters::POS_Y], _fields[CameraParameters::POS_Z]);
return Point3f(_fields[CameraParameters::POS_X], _fields[CameraParameters::POS_Z], -_fields[CameraParameters::POS_Y]);
}
Matrix44f CameraParameters::getRotation()
@ -45,7 +45,11 @@ Matrix44f CameraParameters::getRotation()
// (rot * flip)^T = flip^T * rot^T
Matrix44f transposedFlippedRot = flip.transpose() * rot.transpose();
return transposedFlippedRot;
Matrix44f rotate90;
rotate90.SetRotateDeg(90,Point3f(1,0,0));
Matrix44f rotation = transposedFlippedRot * rotate90;
return rotation;
}
/**************

View File

@ -150,7 +150,7 @@ bool FilterPhotosynthPlugin::applyFilter(QAction */*filter*/, MeshDocument &md,
foreach(p, sys->_pointCloud->_points)
{
tri::Allocator<CMeshO>::AddVertices(mm->cm,1);
mm->cm.vert.back().P() = Point3f(p._x,p._y,p._z);
mm->cm.vert.back().P() = Point3f(p._x,p._z,-p._y);
mm->cm.vert.back().C() = Color4b(p._r,p._g,p._b,255);
}
@ -166,7 +166,7 @@ bool FilterPhotosynthPlugin::applyFilter(QAction */*filter*/, MeshDocument &md,
s.Extrinsics.SetTra(cam.getTranslation());
//add a point to the cameras layer as a placeholder for the camera
tri::Allocator<CMeshO>::AddVertices(mm->cm,1);
mm->cm.vert.back().P() = Point3f(cam[CameraParameters::POS_X], cam[CameraParameters::POS_Y], cam[CameraParameters::POS_Z]);
mm->cm.vert.back().P() = cam.getTranslation();
//find intrinsics
Image img = synthData->_imageMap->value(cam._imageID);
QDir imageDir(path);