jps0611 Posted October 5, 2018 Share Posted October 5, 2018 Howdy friends! How do you make an orthographic camera respond to the browser aspect ratio? Off the shelf it appears that it doesn't respond to the size of the viewport. Am I missing something? http://www.babylonjs-playground.com/#JLPAE Thanks! JPS Quote Link to comment Share on other sites More sharing options...
Wingnut Posted October 6, 2018 Share Posted October 6, 2018 Hiya JPS. I'm not even sure I understand the question... but... I decided to try some experiments. http://www.babylonjs-playground.com/#JLPAE#159 Lines 41-51... goofin' around. Does that code make the camera 'respond' in the way you wish, at all? Perhaps you can adjust that code... to better show the experts what you seek? Often, I'm not qualified to test/answer a question, and this could be the case, here. DK is nearby, and as soon as his Saturday morning Roadrunner cartoon finishes, he'll likely respond. :) jps0611 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted October 6, 2018 Share Posted October 6, 2018 Hello! The OrthographicCamera uses pixels to determine its rendering. So you have to adapt the orthoXXX properties manually when the viewport changes. @Wingnut was really close to the solution: http://www.babylonjs-playground.com/#JLPAE#160 jps0611 and Wingnut 2 Quote Link to comment Share on other sites More sharing options...
jps0611 Posted October 6, 2018 Author Share Posted October 6, 2018 Hi ya @Wingnut and @Deltakosh Gadzooks y'all are good! This is precisely the solution I was struggling to get to. Per usual...many many many thanks! Have a good weekend! JPS Wingnut and GameMonetize 2 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.