royibernthal Posted July 17, 2018 Share Posted July 17, 2018 Engine/resize() seems to be according to screen height. Is there a way to change it to be according to screen width? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 17, 2018 Share Posted July 17, 2018 engine.resize () is for the width and height of the screen logically Try on a PG to shrink the code to enlarge the scene in width and you'll see that it works also for the width and for the height Quote Link to comment Share on other sites More sharing options...
royibernthal Posted July 17, 2018 Author Share Posted July 17, 2018 I'll try to clarify - the meshes in the scene are resized only according to height. Try to resize width (even in PG) - while the canvas and scene will adapt, the meshes won't be resized at all. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 17, 2018 Share Posted July 17, 2018 At home, they are resizing. I see what you mean. I think Deltakosh can answer you better, but I think this is normal. I see correctly resize. If it were not, your object would no longer have the correct starting form after resizing width or height. If you look at a sphere, even after resizing it must remain a perfect sphere and not an oval Quote Link to comment Share on other sites More sharing options...
royibernthal Posted July 17, 2018 Author Share Posted July 17, 2018 Just to make sure we're on the same page, I attached a video. Notice how the meshes are scaled when resizing the window height, and how they stay the same when resizing the window width. The idea is to keep the same aspect ratio, same as it is done now when resizing height, only to have an option to depend on width as well. Same idea as idealWidth and idealHeight in GUI, unless I'm missing something. resize.webm Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 17, 2018 Share Posted July 17, 2018 Yes I understood. But what I see is that the sphere remains a sphere. it does not become oval, so it is resize. IF this was not the case, the sphere would become oval Let's wait and see what Deltakosh will say about that. But I always assume it was normal behavior. Quote Link to comment Share on other sites More sharing options...
royibernthal Posted July 17, 2018 Author Share Posted July 17, 2018 Yes of course, the aspect ratio is maintained, it doesn't mean the same can't be achieved for width. The aspect ratio will simply depend on width instead of on height. The sphere will still remain a sphere. Anyway yeah, let's see what Deltakosh says. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 17, 2018 Share Posted July 17, 2018 I agree that this should be the same result as resizing the height where all the scene is expanding or shrinking. royibernthal 1 Quote Link to comment Share on other sites More sharing options...
Nabroski Posted July 17, 2018 Share Posted July 17, 2018 easy http://www.babylonjs-playground.com/#H5TZ2P royibernthal, GameMonetize, Pryme8 and 2 others 4 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.