StelProjectorClasses.hpp   StelProjectorClasses.hpp 
skipping to change at line 109 skipping to change at line 109
v[1] = 1e99; v[1] = 1e99;
v[2] = -1e99; v[2] = -1e99;
return false; return false;
} }
const double f = 1.0 / h; const double f = 1.0 / h;
v[0] *= f; v[0] *= f;
v[1] *= f; v[1] *= f;
v[2] = r; v[2] = r;
return true; return true;
} }
virtual void project(int n, const Vec3d* in, Vec3f* out)
{
Vec3d v;
for (int i = 0; i < n; ++i)
{
v = in[i];
v.transfo4d(modelViewMatrix);
StelProjectorStereographic::forward(v);
out[i][0] = viewportCenter[0] + flipHorz * pixelPerR
ad * v[0];
out[i][1] = viewportCenter[1] + flipVert * pixelPerR
ad * v[1];
out[i][2] = (v[2] - zNear) * oneOverZNearMinusZFar;
}
}
bool backward(Vec3d &v) const; bool backward(Vec3d &v) const;
double fovToViewScalingFactor(double fov) const; double fovToViewScalingFactor(double fov) const;
double viewScalingFactorToFov(double vsf) const; double viewScalingFactorToFov(double vsf) const;
double deltaZoom(double fov) const; double deltaZoom(double fov) const;
protected: protected:
virtual bool hasDiscontinuity() const {return false;} virtual bool hasDiscontinuity() const {return false;}
virtual bool intersectViewportDiscontinuityInternal(const Vec3d& p1, const Vec3d& p2) const {return false;} virtual bool intersectViewportDiscontinuityInternal(const Vec3d& p1, const Vec3d& p2) const {return false;}
}; };
class StelProjectorFisheye : public StelProjector class StelProjectorFisheye : public StelProjector
skipping to change at line 163 skipping to change at line 178
virtual bool intersectViewportDiscontinuityInternal(const Vec3d& p1, const Vec3d& p2) const {return false;} virtual bool intersectViewportDiscontinuityInternal(const Vec3d& p1, const Vec3d& p2) const {return false;}
}; };
class StelProjectorHammer : public StelProjector class StelProjectorHammer : public StelProjector
{ {
public: public:
StelProjectorHammer(const Mat4d& modelViewMat) : StelProjector(model ViewMat) {;} StelProjectorHammer(const Mat4d& modelViewMat) : StelProjector(model ViewMat) {;}
virtual QString getNameI18() const; virtual QString getNameI18() const;
virtual QString getDescriptionI18() const; virtual QString getDescriptionI18() const;
virtual double getMaxFov() const {return 360.;} virtual double getMaxFov() const {return 360.;}
virtual void project(int n, const Vec3d* in, Vec3f* out)
{
Vec3d v;
for (int i = 0; i < n; ++i)
{
v = in[i];
v.transfo4d(modelViewMatrix);
StelProjectorHammer::forward(v);
out[i][0] = viewportCenter[0] + flipHorz * pixelPerR
ad * v[0];
out[i][1] = viewportCenter[1] + flipVert * pixelPerR
ad * v[1];
out[i][2] = (v[2] - zNear) * oneOverZNearMinusZFar;
}
}
bool forward(Vec3d &v) const bool forward(Vec3d &v) const
{ {
// RealAitoff
// const double r = std::sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]
);
// const double alpha = std::atan2(v[0],-v[2]);
// const double cosDelta = std::sqrt(1.-v[1]*v[1]/(r*r));
// double z = std::acos(cosDelta*std::cos(alpha/2.));
// z = std::sin(z)/z;
// v[0] = 2.*cosDelta*std::sin(alpha/2.)/z;
// v[1] = v[1]/r/z;
// v[2] = r;
// return true;
// Hammer Aitoff // Hammer Aitoff
const double r = std::sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2] ); const double r = std::sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2] );
const double alpha = std::atan2(v[0],-v[2]); const double alpha = std::atan2(v[0],-v[2]);
const double cosDelta = std::sqrt(1.-v[1]*v[1]/(r*r)); const double cosDelta = std::sqrt(1.-v[1]*v[1]/(r*r));
double z = std::sqrt(1.+cosDelta*std::cos(alpha/2.)); double z = std::sqrt(1.+cosDelta*std::cos(alpha/2.));
v[0] = 2.*M_SQRT2*cosDelta*std::sin(alpha/2.)/z; v[0] = 2.*M_SQRT2*cosDelta*std::sin(alpha/2.)/z;
v[1] = M_SQRT2*v[1]/r/z; v[1] = M_SQRT2*v[1]/r/z;
v[2] = r; v[2] = r;
return true; return true;
} }
 End of changes. 3 change blocks. 
12 lines changed or deleted 32 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/