StelProjector.cpp   StelProjector.cpp 
skipping to change at line 103 skipping to change at line 103
e2 = v; e2 = v;
} }
const double d = e3*((e2-e3)^(e1-e3)); const double d = e3*((e2-e3)^(e1-e3));
if (d > 0) if (d > 0)
{ {
SphericalConvexPolygon* res = new SphericalConvexPolygon(e0, e1, e2, e3); SphericalConvexPolygon* res = new SphericalConvexPolygon(e0, e1, e2, e3);
if (res->checkValid()) if (res->checkValid())
{ {
return SphericalRegionP(res); return SphericalRegionP(res);
} }
qDebug() << "!valid"; //qDebug() << "!valid";
delete res; delete res;
} }
//return SphericalRegionP((SphericalRegion*)(new AllSkySphericalRegi on())); //return SphericalRegionP((SphericalRegion*)(new AllSkySphericalRegi on()));
const SphericalCap& hp = getBoundingCap(); const SphericalCap& hp = getBoundingCap();
return SphericalRegionP(new SphericalCap(hp)); return SphericalRegionP(new SphericalCap(hp));
} }
void StelProjector::computeBoundingCap() void StelProjector::computeBoundingCap()
{ {
bool ok = unProject(viewportXywh[0]+0.5f*viewportXywh[2], viewportXy wh[1]+0.5f*viewportXywh[3], boundingCap.n); bool ok = unProject(viewportXywh[0]+0.5f*viewportXywh[2], viewportXy wh[1]+0.5f*viewportXywh[3], boundingCap.n);
skipping to change at line 175 skipping to change at line 175
{ {
v[0] = flipHorz * (x - viewportCenter[0]) / pixelPerRad; v[0] = flipHorz * (x - viewportCenter[0]) / pixelPerRad;
v[1] = flipVert * (y - viewportCenter[1]) / pixelPerRad; v[1] = flipVert * (y - viewportCenter[1]) / pixelPerRad;
v[2] = 0; v[2] = 0;
const bool rval = backward(v); const bool rval = backward(v);
// Even when the reprojected point comes from a region of the screen , // Even when the reprojected point comes from a region of the screen ,
// where nothing is projected to (rval=false), we finish reprojectin g. // where nothing is projected to (rval=false), we finish reprojectin g.
// This looks good for atmosphere rendering, and it helps avoiding // This looks good for atmosphere rendering, and it helps avoiding
// discontinuities when dragging around with the mouse. // discontinuities when dragging around with the mouse.
// We need no matrix inversion because we always work with orthogona modelViewTransform->backward(v);
l matrices (where the transposed is the inverse).
//v.transfo4d(inverseModelViewMatrix);
x = v[0] - modelViewMatrix.r[12];
y = v[1] - modelViewMatrix.r[13];
const double z = v[2] - modelViewMatrix.r[14];
v[0] = modelViewMatrix.r[0]*x + modelViewMatrix.r[1]*y + modelViewMa
trix.r[2]*z;
v[1] = modelViewMatrix.r[4]*x + modelViewMatrix.r[5]*y + modelViewMa
trix.r[6]*z;
v[2] = modelViewMatrix.r[8]*x + modelViewMatrix.r[9]*y + modelViewMa
trix.r[10]*z;
return rval; return rval;
} }
 End of changes. 2 change blocks. 
14 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/