diff -r fad4a5dd8dee -r 5c0005f63319 src/gl/partrenderer.h --- a/src/gl/partrenderer.h Wed Feb 26 22:26:05 2020 +0200 +++ b/src/gl/partrenderer.h Thu Feb 27 11:56:41 2020 +0200 @@ -24,6 +24,7 @@ ~PartRenderer() override; void setRenderPreferences(const gl::RenderPreferences& newPreferences); static glm::vec3 viewport(const glm::vec3& point, float width, float height); + static glm::vec3 antiviewport(const glm::vec3& point, float width, float height); protected: ldraw::Id pick(const QPoint& where); void initializeGL() override; @@ -39,6 +40,7 @@ ldraw::Id highlighted = ldraw::NULL_ID; std::optional screenToModelCoordinates(const QPoint& point); QPointF modelToScreenCoordinates(const glm::vec3& point); + glm::vec3 unproject(const glm::vec3& win); private: void setFragmentStyle(gl::FragmentStyle fragStyle); void renderAllArrays(); @@ -50,6 +52,7 @@ gl::RenderPreferences renderPreferences; glm::mat4 projectionMatrix; glm::mat4 viewMatrix; + glm::vec4 viewportVector; glm::quat modelQuaternion; std::optional gridProgram; static constexpr double MIN_ZOOM = 0.0;