From: <dom...@so...> - 2002-11-07 10:22:10
|
Hi there, In my program I render the same model, loaded from an .obj file, several times with different transformations. I also have a sky box (six quads with texture) and a floor plane (one quad with texture) rendered afterwards. In the rendering loop, I first use a for loop to render the copies of model in different location by glTranslatef, and different scale by glScalef. Afterwards, the floor plane and skybox are rendered. The scene is rendered without any problem, and I could move through the scene smoothly (I use glTranslatef and glRotatef to do this). The problem comes when I click the mouse button -- when releasing the button, part of the objects (but not all of them) flashes, while the floor plane and skybox remain still (I never found them flash). The flash doesn't occur everytime, but is quite frequent. I've read some old posts here, and try to follow the suggestions such as implementing the mouse listener and leaving the click event blank, but the problem presists. Even setting mouse listener to null doesn't help. (Note: I have the mouse listener seperated as another class, but not in GLAnimCanvas.) And when I look into my code, I found something interesting -- if I comment out the glScalef line, everything goes well! Or, if I unroll the for loop by hand, the frequency of flashing will be greatly reduced. Unrolling the loop is not feasible, since I would have unknown number of objects, but I wonder if glScalef is the real trouble maker. Do anyone got idea on this? Thanks. Dominic Kwan PS. Sorry for poor English... |