New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I noticed different screen sizes cause incorrect positioning of objects #6249
Comments
Hmmm, could you share screenshots? |
Hello mrdoob, The device i used is a HTC one mini as you can see when i click on the grid in the bottom right corner the block appears in the middle left. To let you know the webgl voxel painter demo on the same pages works fine on the same device |
It also have the same problem when your browser is in zoom mode (cmd+plus). |
Thanks for your comment I looked at the previous release example code and found r28 worked fine. Since then none of the other release example code seemed to work for the voxelpainter example. Adding render() to the onDocumentMouseDown function got it working fine on the HTC one mini smartphone:
|
What mobile browser is that with? |
Default android browser v 6.0.798481 on a HTC one mini 2. Android version 4.4.2. I think this version uses the Chromium 30 browser. Am using the browser is an application using webview |
I see. I was confused because that example doesn't have touch events. |
Thanks for the info. I thought might have worked ok. I understand is a little old now but used your r28 version (http://mrdoob.com/projects/voxels/) in the mobile browser with cubes being placed in the correct places perfectly. I'd like to use merge with cubeGeometry and place the cubes in the correct place. Will keep trying, thanks for your comments |
Am so pleased got the example working for r71. In function onDocumentMouseDown(event) changed the following: from mouse.x = (event.clientX / renderer.domElement.width) * 2 - 1; to mouse.x = (event.clientX / window.innerWidth) * 2 - 1; Thanks again for your help |
Yays! |
I noticed different screen sizes cause incorrect positioning of objects.
Best example of this is using this page:
http://threejs.org/examples/#canvas_interactive_voxelpainter
On larger laptop screen the cubes are positioned correctly, when viewing the same page on a smaller smartphone screen blocks are positioned in consistently incorrect positions.
Click in the bottom right corner of the grid and the blocks get positioned in the center
The text was updated successfully, but these errors were encountered: