jeudi 12 mars 2015

Wrong Timing relative to Windows Message Loop in 3D appli?


I have got a Pb possibly with timing in regards of the Windows Message Loop, I think (?):


While Manipulating a 3D scene drawn under (OpenGL + C++) for Windows, I want that in response to a WM_ LBUTTONDOWN user event , to change continuously the camera position from a point A to point B ( but with same lookAt point). I would like also a ~ 2sec duration for that move:


In my OnLButtonDown() handler for WM_ LBUTTONDOWN message, I enter a 100 iterations loop like this:


{ m_camera.setEyePos(...pos #i...);


SendMessage(m_hWnd, WM_PAINT,0,0);}


ending at the desired camera position.




BUT my scene isn't redrawned at all in the 99 intermediate states: It is just redrawn in the final position! (but in a correct way) it jump directly from the initial point of view to the final one! (but it takes 2sec to do so, as intended..)




What's wrong? Can you help? Thanks.


P.S. Sorry for my English (I am French..) ...and beginner with Windows programming...




Aucun commentaire:

Enregistrer un commentaire