diff options
author | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2015-12-10 18:58:09 +0300 |
---|---|---|
committer | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2015-12-29 16:42:33 +0300 |
commit | 2996e48cee3838dc1c1451251e03b4cfa2ef4af6 (patch) | |
tree | 57cb1ac9e4c652326535f568538d9d8a8cc5b9ff /geometry | |
parent | 046e8f6b0fc5eb8748fc66900439ad227279fb3d (diff) |
Rendering poi and texts on the tops of buildings.
Diffstat (limited to 'geometry')
-rw-r--r-- | geometry/screenbase.cpp | 8 | ||||
-rw-r--r-- | geometry/screenbase.hpp | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/geometry/screenbase.cpp b/geometry/screenbase.cpp index b6b46fb4e8..f1eb81e4ad 100644 --- a/geometry/screenbase.cpp +++ b/geometry/screenbase.cpp @@ -356,11 +356,17 @@ void ScreenBase::ResetPerspective() m2::PointD ScreenBase::PtoP3d(m2::PointD const & pt) const { + return PtoP3d(pt, 0.0); +} + +m2::PointD ScreenBase::PtoP3d(m2::PointD const & pt, double ptZ) const +{ if (!m_isPerspective) return pt; Vector3dT const normalizedPoint{float(2.0 * pt.x / m_PixelRect.SizeX() - 1.0), - -float(2.0 * pt.y / m_PixelRect.SizeY() - 1.0), 0.0, 1.0}; + -float(2.0 * pt.y / m_PixelRect.SizeY() - 1.0), + float(2.0 * ptZ / m_PixelRect.SizeX()), 1.0}; Vector3dT const perspectivePoint = normalizedPoint * m_Pto3d; diff --git a/geometry/screenbase.hpp b/geometry/screenbase.hpp index 850b1c2076..016feab973 100644 --- a/geometry/screenbase.hpp +++ b/geometry/screenbase.hpp @@ -140,6 +140,7 @@ public: bool isPerspective() const { return m_isPerspective; } m2::PointD PtoP3d(m2::PointD const & pt) const; + m2::PointD PtoP3d(m2::PointD const & pt, double ptZ) const; m2::RectD PixelRectIn3d() const { |