Othographic Projection in XTK

北城以北 提交于 2019-12-20 06:18:35

问题


So I am using XTK to develop a app that will allow users to view multiple 3D meshes in one renderer. The problem is that it uses a perspective camera instead of a orthographic, which causes panning to 'rotate' the meshes a bit. Has anyone been successful in getting XTK to render orthographically without modifying source code? I would rather not modify it but if I have to I will. Thank you!


回答1:


So from what I can see, there's no way to set a 3D camera to be in orthographic perspective without modifying the source code. However, it seems fairly straight forward to add that functionality. If you add the following in a function to camera3D.js, that should get the right result (I tested it on XTK Tutorial 00).

this._perspective = X.matrix.makeOrtho(X.matrix.identity(), -100, 100, -100, 100, 1, 10000);

It uses goog.vec.Mat4.makeOrtho



来源:https://stackoverflow.com/questions/24495161/othographic-projection-in-xtk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!