Results 1 to 5 of 5

Thread: QGraphicsView and fast moving objects

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default QGraphicsView and fast moving objects

    Hi,
    I've been making a pong clone using a QGraphicsView, but i seem to have an issue with moving objects rapidly within the view e.g. the ball, which i have updating around 40Hz.

    1/ it's blurry.. I expect abit of blur because of the movement, but it seems as if the ball is being painted in it's new position, before the old position has been repainted, ie for an instant it's in two places at once. It makes it kinda difficult to focus (literally) on the ball, though some of this may be subjective.

    2/ there's tearing/artifacting. not all the time, but if you watch the ball for 10s or so you'll see it.

    I've tried playing around with different caching modes, on both the ball graphicsItem and the graphicsScene itself, but with little success. I've also tried disabling the viewport updates and managing the updating myself, but the same problems occur.

    I've included a sandbox example of a ball bouncing around so you can check it out (only compiles for windows, sorry), i must be doing something obvious wrong, as i know GV can handle thousands of items, surely it can handle one fast ball?!
    Attached Files Attached Files

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.