Jump to content
  • Advertisement
Sign in to follow this  
3DModelerMan

Smoother camera movement in editor?

This topic is 2506 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do most game editors handle camera rotation? I have this right now:


case WM_MOUSEMOVE:
if ( wParam == MK_LBUTTON )
{
static int lastXPos = GET_X_LPARAM(lParam);
static int lastYPos = GET_Y_LPARAM(lParam);
int xPos = GET_X_LPARAM(lParam);
int yPos = GET_Y_LPARAM(lParam);
g_app->rotateCamera(ice::core::Vector3((float)yPos-(float)lastYPos, (float)xPos-(float)lastXPos, 0).normalize());
lastXPos = xPos;
lastYPos = yPos;
}
break;


I want something that's not so slow and jumpy though. Any suggestions?

Share this post


Link to post
Share on other sites
Advertisement
Store the previous position of the mouse and the new position, each with timestamps.

Interpolate to the position that is 10 or so milliseconds behind the timestamp of the current render.
You do render constantly, yes?


L. Spiro

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!