abou.konate Posted August 24, 2012 Posted August 24, 2012 Hi again, Working with the vizualiser I noticed that with low rate FPS, the visualizer produce artifact : It's seem that the scene rendering is delayed one frame after the vizualizer. So here you will see the grid partially on the mesh when it should be totally under (see on the right)
frustum Posted August 29, 2012 Posted August 29, 2012 You should set correct modelview/projection matrices for visualizer each frame before calling visualizer.renderXXX functions: engine.visualizer.setProjection(projection); engine.visualizer.setModelview(modelview);
abou.konate Posted August 29, 2012 Author Posted August 29, 2012 Okay so it's seems that it's was the last frame projection/modelview. Thank you.
ulf.schroeter Posted August 30, 2012 Posted August 30, 2012 You should set correct modelview/projection matrices for visualizer each frame before calling visualizer.renderXXX functionsIs there a special reason why this is not done automatically by the engine on render frame start based on active player ?
abou.konate Posted August 30, 2012 Author Posted August 30, 2012 Actually ulf.schroeter it is set automatically during the render() method , that why I've been fooled. The subtle thing is that even if the perspective should not cause trouble, when addRender*** is called, points positions are transformed with the current modelview matrix, which turns out to be the last frame matrix.
ulf.schroeter Posted August 30, 2012 Posted August 30, 2012 fully understood, it was more a question to UNIGINE crew, why visualizer are not automatically synchronized with current player transformation by the engine itself without any explicit user intervention. There had been already some one frame off problem between player and visualizer in the past (2009) which had been fixed.
manguste Posted September 13, 2012 Posted September 13, 2012 The reason is that such approach reduces the number of calculations. Otherwise, matrices would be reset each time the player position changes. We also need to check if the visualizer is loaded, if the editor or game player is used. If compared to only 2 functions to set modelview and projection matrices, the overhead can be pretty noticeable, especially in case complex behaviour of the camera is implemented in scripts. I've added a notice into docs to clear this issue out.
Recommended Posts