Advertisement

NeHe Lesson 32 display issues

Started by July 24, 2005 02:37 PM
-1 comments, last by ScottNCSU 19 years, 1 month ago
In Lesson 32, the shooting gallery, 2D objects fly across the screen at a relatively slow rate using time based movement. At this point, things look fine. However, if you increase the speed of those objects just slightly, and take away their rotation, ugly display issues start showing. The object looks only half drawn from the first and next frame as it flies across the screen, so theres a "I'm still drawing" line through the middle of it. This issue doesn't show up when the object is moving at a slow speed, and I'm not sure what the technical term for it is. Also, it doesn't matter what FPS you force the game to run at. The problem gets much worse when you increase the size of a sprite. I'm using Lesson 32 as the base code for my game engine, and have already added a good 500 lines of engine code (physics, collision detection, projectile classes etc.) so I'd like to fix this issue as soon as possible. I'm assuming its not the fault of my "new" 19" CRT monitor. I certainly haven't noticed this in any professional games I've played on my computer. Could someone take a look at the source code and see if they can find the issue? To increase the speed of the objects so you can see the issue, simply go to line 561 in Lesson32.cpp (or around there, I'm using the DevC++ project file), and A. comment out the rotation, B. increase the speed of the objects slightly. I changed the x value to 0.017f, I believe it was 0.012f: object[loop].x+=0.017f*float(milliseconds); If you really want to see the issue in all its uglyness, change the size dimensions of the objects from {1.0, 1.0} to {2.5, 2.5}. Thanks. EDIT: I know I've read about this issue somewhere and some graphic engines have ways to combat it but I can't recall the technical term for the issue or the solution to that issue. I'm sure one of you will recognize it.

This topic is closed to new replies.

Advertisement