Comments (10)
Oh no. You are absolutely right, and it is also in the 0.7 release 😞 Will look into it as soon as I have time. If anyone wants to try to fix it, please go ahead 💪
from three-d.
@kklibo You actually said it was in 0.7 release, so not on master? I cannot reproduce it anymore on 0.7 nor master, but I also think I have seen it before, so it might be something that occurs in some specific circumstances that I can't figure out. It works a bit weird on firefox also so I will try to fix that. If you have some more input, please let me know 👍
from three-d.
I just went back through my repo and did a more thorough round of tests. The problem occurs in Firefox and Chromium with three-d:
- 0.7.3
- 0.7.0
- 0.6.0
- 0.5.0
I went back to 0.4.2, but I wasn't using dynamic sizing back then. I was pretty sure this issue was new, but it's possible that I just never noticed.
It's possible that the problem is in my code, but I can't think of where it would be. I don't think I ever set a render area or window size, I just receive it from three-d and use it in rendering calculations. Any ideas?
from three-d.
So the error is consistent? I have seen it once in a while but it went away with a refresh which is the reason why I did not do anything about it. I have absolutely no idea what to do, it is really hard to fix something you cannot reproduce. I think the bug is most likely in canvas.rs which has all of the resize logic so very limited amount of code to look into, but it could also be in web_sys or even lower level.
from three-d.
Yeah, it's 100% consistent on my project. I spent about 45 minutes taking a look at canvas.rs and making some changes, but I couldn't get the problem to go away or change at all.
When I modify the canvas size, it changes the resolution of the graphics which are written into the graphics area in the browser window (causing blurring when it isn't 1:1), but that graphics area remains the same size: slightly too large for the browser window (and the scrollbars remain).
If you can think of anything else to try, I'm available to test it. In the mean time, I'm working on uploading a (very early) version of my project soon: it may make sense to revisit this when that's available.
from three-d.
Yet again, thanks for your effort! 👍 I cannot reproduce it at all on my laptop, so I was thinking that maybe it is the setup (my best guess is the screen). I will do some experiments soon on whatever hardware I have.
And I think it is wise to leave it for a moment 🙏 And sounds super nice that you are ready with an (early) version 💪
from three-d.
@asny Here's a (very early) version of my project:
https://github.com/kklibo/panorama-explorer
Running this in a browser should show the view area size problem (and a small subset of a panorama series near Shoreline Ampitheatre in Mountain View, CA).
from three-d.
Super nice to actually see it, got it running in no time 💥 My only feedback is that it is a bit hard to zoom with a touchpad 🙂
Now that I can see your code, I found out why you have troubles and I don't. I had added some CSS styling to the index.html file:
<canvas style="position: absolute;top:0;bottom: 0;left: 0;right: 0;margin:auto;"></canvas>
instead of:
<canvas id="canvas" height="720" width="1280" />
which is what you have in your index.html. I guess you have tested the examples with that index.html and not the revised one at github?
Anyway, change that line in your index.html and it should work 🎉
from three-d.
Perfect, It works now.
Yeah, my index.html was ancient, and Intellij was "helping" me by hiding the content of that canvas line.
Re: touchpad zoom: this UI is very temporary, but there are zoom buttons on the control window. Are they too small? I haven't used a tablet in years, so I really don't know what it takes to make the UI usable.
from three-d.
Good it is working 👍
Perfectly all right, the zoom buttons works so it is not a big problem. I didn't test on a tablet but a MacBook with a touchpad. And I actually think the examples zoom doesn't work that well with both touchpad and mouse wheel, so maybe I have something to fix as well 🙂
from three-d.
Related Issues (20)
- `MouseMotion` events return 0 delta when using `winit::window::CursorGrabMode::Locked` HOT 1
- Add Shadow Catcher material support HOT 3
- glow, egui, and three-d dependency issue, mostly just needs a coordinated release HOT 1
- Uncaught runtime errors
- "You forgot to call destroy() on the egui glow painter. Resources will leak!" HOT 3
- Centering the camera on a model HOT 4
- `Camera` is trying to do too much - not compatible with custom camera implementations HOT 2
- Headless on windows HOT 2
- Weird stretching when rendering finite terrain HOT 2
- Converting between ui space and screen space? HOT 2
- How to control occlusion for 2D shapes? HOT 7
- InstancedMesh but with different material for each instance HOT 5
- Run three-d from egui app HOT 1
- Camera position_at_pixel() is missing window_scale_factor on HiDPI displays HOT 2
- Any plans to support custom buffer element types for interleaved data? HOT 1
- ColorMaterial Transparency breaks when renderered at negative Y position? HOT 2
- Upgrading V0.16.1 => V0.17 breaks loading a 1x1 pixel white texture HOT 2
- Some kind of blend/alpha issue with some models (inside-out models) HOT 1
- Trying to use PhysicalMaterial without lights crashes the program HOT 1
- Warning when running on the browser / crash in debug mode 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 three-d.