chicagobob123 Posted January 26, 2018 Share Posted January 26, 2018 I set the mode to ORTHOGRAPHIC_CAMERA and wanted to move it around. This I thought would be easy just set the rotate.y to spin it or position.y to zoom in and out but I was wrong. I rotated the camera 90 degrees in the X axis to have a top down view. And what I see rendered doesnt make any sense. The sphere is oblong. You rotate the image (use shift Left or right arrow on the keyboard) and it keeps that the oblong view facing up. Another question is why is the rotational center so far off? Where is the axis? Here is some code to look at. https://www.babylonjs-playground.com/#21YCLG#17 To move around use keyboard Left arrow right arrow Up arrow down Arrow movement and shift left arrow and right arrow to rotate. Mouse wheel for zoom in and out. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 2, 2018 Share Posted February 2, 2018 Hiya cb123! No replies yet, eh? Sorry. I'm doing a little bump-to-the-top on this one. Thx for your patience. Quote Link to comment Share on other sites More sharing options...
chicagobob123 Posted February 2, 2018 Author Share Posted February 2, 2018 I have been working hard on this problem and its WAY harder than you think. The camera has quirks that I can not fix. There is no concept of elevation for zoom. Instead you have to make up your own elevation track your own zoom. Anyway.. These numbers are supposed to have a black background to them created by a dynamic texture. It works correctly when you use a regular camera. When I get a chance I will put it onto Playground. I have another issue as well so far with a particle thats black viewing from the ORTHOMODE Quote Link to comment Share on other sites More sharing options...
Guest Posted February 2, 2018 Share Posted February 2, 2018 If you find bugs that you can repro in the PG I'll make sure to fix them Quote Link to comment Share on other sites More sharing options...
Christoph Posted February 5, 2018 Share Posted February 5, 2018 for (var i = 0; i < mscene.meshes.length; i++){ if (mscene.meshes.isVisible == false) continue; var bounds = mscene.meshes.getBoundingInfo(); That's 99% your culprit, you get your min/max x,y,z values based on different meshes in your scene. Or in other words: you are distorting your camera by using something like: Left = -5 Right = +10 Top = +6 Bottom = -9 You want to use instead: scale = 5 Left = - scale Right = scale Top = scale Bottom = -scale This will capture your "world" from -5 to +5 around the camera's position and "squeeze" it into it's output. If you use however different scales for x and y you will distort your output. Edit: Here is a quick "fix" - Lines 171-173. https://www.babylonjs-playground.com/#21YCLG#41 Wingnut 1 Quote Link to comment Share on other sites More sharing options...
chicagobob123 Posted February 21, 2018 Author Share Posted February 21, 2018 The best way I dealt with this is do NOT rotate the orthographic camera. Not worth the issue when it comes the math figuring out the proper aspect etc to know the width and height. 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.