Advertisement

[OpenGL] flickering animation in Linux

Started by April 11, 2002 08:38 PM
3 comments, last by TraHari 22 years, 10 months ago
Greetings, To begin with, I''m doing this in Linux with the NVidia libs and module installed, and I''m using the stuff by Richard Campbell which seems to involve some GLUT and GL. Whenever there''s any kind of animation, the polys in question flicker a whole heck of a lot. I''m wondering what exactly I should do about this. I _suspect_ that it has to do with the fact that the polygon drawing takes place DrawGLScene, and DrawGLScene is defined as both the display function _and_ the idle function, but I''m not 100% sure. Anyone have any idea? - Tra''Hari
Okay, scratch that. I managed to fix the problem; I was attempting to animate my colors, and it seems like that was the problem. I still can''t get them to animate, but that''s not a big deal; I''m just glad it''s not flickering.

However, this flickering problem shows up in a number of mesa demos... with the bounce, and the tunnels, and things like that. So, if anyone has any ideas about what might be causing that, lemme know?

- Tra''Hari
Advertisement
You''ll have to explain what *exactly* you see. It might be that your not using double buffering. Also, mesa has some bugs that cause strange visual artifacts.
Greetings,

I''ll use the tunnel demonstration as an example.

It seems like ordinarily, you''re supposed to be looking at a stationary tunnel that you can move through, rotate around, et cetera. However, it looks like you''re already moving very, very quickly. The walls appear to be moving forward and backward as they flash. There''re windows, and those also appear to be moving.

However, if I accelerate slightly, they flash more consistently; I can kind of make out what it''s _supposed_ to look like, but the walls and floor appear to be jumping forward and backwards in rapid succession.

Meanwhile, the FPS counter reads something that''s anywhere between 280fps and 450fps. Now, I have a gf3 ti200, and I''m running a duron 900 oced to 1ghz, but it seems like this''s just ridiculous. The fr went down when I started loading some apps to test, and even when it went down as far as 60, it was still screwy, although the walls appeared to be moving more slowly (even while I was stationary in the tunnel).

Also, while I''m running tunnel (but _not_ any of the NeHe demos), applications in the background become graphically corrupted. Mostly, this happens with mozilla, since that''s usually what I have open, but I just tested it with Nautilus, Vim, Gaim, and Gnome terminal, and it didn''t corrupt those.. while mozilla was corrupted even though it was minimized.

I would go poking through the code, but since it''s not commented at all and it uses the usual terse to nigh incomprehensible C style of naming variables, I have no idea what I would go about changing.

It''s worth noting that I managed to fix somehting that looked like this in my own code based on the triangle tut. I fixed it by turning down the number by which rotation was incremented.

This also showed up in the Linux texturing tut, which I also fixed by turning down the rate at which the thing rotated... in the Linux code, the rotation is incremented by 15, which makes it move much too quickly, giving it that flashing appearance.

However, I don''t really have all that much evidence that these are related to the issue with the tunnel.

Isn''t there some way to make rotation a function of time, or something along those lines? I seem to recall having seen this a while ago, but I don''t remember how it was done. Using the clock seems like it would be more precise, and less prone to weird things like this.

- Tra''Hari
quote:
Original post by TraHari
Isn''t there some way to make rotation a function of time, or something along those lines? I seem to recall having seen this a while ago, but I don''t remember how it was done. Using the clock seems like it would be more precise, and less prone to weird things like this.

- Tra''Hari


Just create a glut timer function to increase the rotation every few hundred miliseconds or whatever.

void increaseRot(int amount)
{
g_rot += amount;
glutTimerFunc(200, increaseRot, g_rotIncreaseAmount);
}

glutTimerFunc(200, increaseRot, g_rotIncreaseAmount);

That would create a timer function called every 200 miliseconds that would increase the global rotation amount by g_rotIncreaseAmount.




This topic is closed to new replies.

Advertisement