Hi All,
Hope everyone had/is having a nice holiday with plenty of “Nog”
I’m making an editor [everyone does] and since I enjoy Blender, that is what my editor is based upon. At present I have all the basic functionality (very basic) of the viewing using the keypad to rotate, roll, switch between views but here is the wall I’ve run up against and it might be the “Nog”.
When I toggle between Perspective and Orthographic (Perspective/Parallel) projections (I’ve used renderManager.setCamera(cam, true/false) which I have read the docs about the steps that uses, also I’ve used the cam.setParallelProjection(true/false)…) and both are smack on as to changing modes which is great but as I see in the Docs for the renderManager
Blockquote
First, the camera’s view port parameters are applied. Then, the camera’s view and projection matrices are set on the renderer. If ortho is true, then instead of using the camera’s view and projection matrices, an ortho matrix is computed and used instead of the view projection matrix. The ortho matrix converts from the range (0 ~ Width, 0 ~ Height, -1 ~ +1) to the clip range (-1 ~ +1, -1 ~ +1, -1 ~ +1).
Parameters:
cam - The camera to set
ortho - True if to use orthographic projection (for GUI rendering), false if to use the camera’s view and projection matrices.
Note: Many thanks to the engine showing “Your topic is similar to…” which is VERY useful but I’m unable to find my answer to the question which is;
When I change modes the frustum is changed (of course, and as expected) to where the camera seems either VERY close to the box in the centre of my grid (ORTHO/PARALLEL) or VERY far away when in Perspective…again this is expected but here is where I’m banging my head…HOW do I account for the projection changes so that, like in Blender, when in EITHER mode the camera shows the view at the same distance/depth.
That “should” be easy to accommodate but I sure as heck am at an impasse for the last 2 days on how to make the PERSPECTIVE/PARALLEL(ORTHO) projections appears as they do in Blender.
Many thanks in advance for some insight or just straight out formula for making the mode toggle to view like in Blender (equidistant in either mode).
Adam