Jump to content
  • Advertisement
Sign in to follow this  
Hachaso

Object movement

This topic is 3825 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

Hi! I am trying to figure out how movement of object on the screen work. I have drawn an image on the screen. I use a texture of an album photo. I would like to move this image over the screen when I press the Left arrow on the keyboard. I guess that what you use is send the new x-coordinates to glTranslatef. The problem I face is that the jump to the new coordinate is not smooth. Can I use any kind of filter to make it smooth or do I have to send every little coordinate change to glTranslatef to make it smooth ?? example: from 0.0f - 2.5f Do i have to plot ?? 0.0f -> 0.01f -> 0.02f -> ... -> 2.5f Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Yeah, either use a smaller increment instead, e.g. 0.0f -> 1.0f, or you have to interpolate within the larger range in smaller steps.

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!