Comments (13)
Thanks for reporting the potential issue.
I don't have such a device for debugging, which makes it tricky for me.
Can you attach some snapshots?
from easy3d.
By checking your code, I found that you have changed
const auto y = height() - (i + 1) * view_height_;
to
const auto y = i * view_height_;
This seems wrong because the OpenGL tradition is to have the origin of the coordinate system at the lower left corner. But the window system (based on GLFW) has that at the top left corner.
I still believe the dpi_scaling should be applied, so I guess your change to the calculation of the Y coordinate is the source of the issue. Can you please check?
from easy3d.
Of course,
from easy3d.
By checking your code, I found that you have changed
const auto y = height() - (i + 1) * view_height_;
to
const auto y = i * view_height_;
This seems wrong because the OpenGL tradition is to have the origin of the coordinate system at the lower left corner. But the window system (based on GLFW) has that at the top left corner.
Ah, I didn't was aware of this OpenGL tradition. So sorry for this unnecessary change.
from easy3d.
So I changed this part back and that's the result:
And that's the diff now:
diff --git a/easy3d/viewer/multi_viewer.cpp b/easy3d/viewer/multi_viewer.cpp
index 3116de7d..1eeb59cf 100644
--- a/easy3d/viewer/multi_viewer.cpp
+++ b/easy3d/viewer/multi_viewer.cpp
@@ -223,13 +223,15 @@ namespace easy3d {
for (int i = 0; i < num_rows_; ++i) {
auto &row = views_[i];
const auto y = height() - (i + 1) * view_height_;
- for (int j = 0; j < num_cols_; ++j)
+ for (int j = 0; j < num_cols_; ++j) {
+ const auto x = j * view_width_;
row[j].viewport = ivec4(
- static_cast<int>(static_cast<float>(j * view_width_) * dpi_scaling()),
- static_cast<int>(static_cast<float>(y) * dpi_scaling()),
- static_cast<int>(static_cast<float>(view_width_) * dpi_scaling()),
- static_cast<int>(static_cast<float>(view_height_) * dpi_scaling())
+ static_cast<int>(static_cast<float>(x)),
+ static_cast<int>(static_cast<float>(y)),
+ static_cast<int>(static_cast<float>(view_width_)),
+ static_cast<int>(static_cast<float>(view_height_))
);
+ }
}
// ------------------------------------------------------------
from easy3d.
Btw thanks for this wonderful piece of code.
I've been looking for a real high level 3D library for a long time, without the need for masses of glx boilerplate code and then luckily I found this one.
from easy3d.
Thanks for your kind words!
I believe the issue is in some other part(s) of the code. For now, you can use your workaround solution.
I cannot debug it because I don't have such a device, but I will check with some friends if can further investigate this issue.
Can you change, in the main.cpp
file, from
initialize();
to
initialize(true);
Then you will see a log file Tutorial_205_MultiView.log
will be generated next to the executable. I would be grateful if you post the entire log here, in the hope that I can find some clue about the issue.
from easy3d.
Of course. Here there are:
Without patch:
Tutorial_205_MultiView.log
With patch:
Tutorial_205_MultiView-with_patch.log
As far as I can see, they are identical.
from easy3d.
I don't have a Linux machine with a hidpi screen. But I've tried to fix this issue using a Mac (which has hidpi).
The new code is in the 'hidpi' branch: https://github.com/LiangliangNan/Easy3D/tree/hidpi
Can you check if it works and post a snapshot here?
from easy3d.
Sorry, no change on my machine with that fix.
from easy3d.
Okay. Then please go with your changes. I will have to find a proper machine to further explore the issue.
from easy3d.
Just for completeness, I testet now also under windows10 on the same machine and got the same results, as under linux:
from easy3d.
I forgot to mention a very small change to compile it with Visual Studio 2017:
diff --git a/easy3d/util/console_style.cpp b/easy3d/util/console_style.cpp
index d2d793ee..2a5632f3 100755
--- a/easy3d/util/console_style.cpp
+++ b/easy3d/util/console_style.cpp
@@ -30,6 +30,7 @@
#include <vector>
#include <cstring>
#include <cstdlib> // for std::getenv
+#include <string>
namespace easy3d
{
But that's does not affect this issue
from easy3d.
Related Issues (20)
- Does Easy3D have scene editing functions?
- Running first time HOT 7
- Off topic, compatibility questions: Will this work with unusual IDEs using old software versions? HOT 3
- [BUG] - dpi_scaling distorts multi viewports HOT 2
- Addressing Non-Manifold Vertex Issues During Mesh Loading in OBJ format: HOT 1
- Problem with V2.5.2: failed to make context current HOT 3
- How do I add new button functions HOT 5
- [Feature request] HOT 1
- not responding HOT 2
- [BUG] - fitScreenRegion change the pivot point HOT 2
- how to automate the RANSAC primitive extraction and how to use it in python project. HOT 1
- Compile error using QT HOT 9
- [Feature request] - DXF file read/write HOT 5
- [BUG] - imgui not working in v2.5.3 on Windows HOT 2
- Render color alpha Settings HOT 3
- I have a picture control in c++ mfc, how i show the view to my picture? HOT 8
- [HELP] - wrong compile about nanoflann package HOT 3
- Model Matrix HOT 4
- Buliging own project on Visual Studio Code not finding Easy3D_RESOURCE_DIR HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easy3d.