Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
camera movement with the fractional time value
sajis997 last edited by SGaist
I am going through an functional opengl application which I shall be trying to move to Qt with QtQuick and C++ integration. I am following the post "OpenGL under QML"
The typical opengl application has a render function as follows:
//timing related calcualtion //store the current time , which is initially ZERO last_time = current_time; //now ge the current time current_time = glutGet(GLUT_ELAPSED_TIME)/1000.0f; //calculate the fractional time difference dt = current_time-last_time;
Initially the current_time and last_time is initialized to ZERO. The fractional value dt is then used to do the camera movement within the scene. How do I achieve something similar from Qt Quick. Probably there is a better way to achieve the same issue in QtQuick. Any hint ?
By the way, is it possible to enable the code highlighter here in the post. I used do it using the [code] ...... [/code] , but it is not working here.
[edit: add missing coding tags: 3 ` before and after the code SGaist]
A Former User last edited by A Former User
var t0 = new Date() var t1 = new Date() var dt = t1 - t0; // delta in ms