PickPolygon reporting nothing

Started by cyberkilla, February 08, 2007, 10:51:37 PM

Previous topic - Next topic

EgonOlsen

Ok, then is assume that this still is a threading problem. Doing a synchronized on the methods doesn't help here, because you can only synchronize on instances, in this case one synchronizes on the factory and one on the pane.
Try this: Create a simple public final static Object (called SYNC for example)...in the factory and do a synchronized(RenderFactory.SYNC) {....} around both method bodys. That way, the state of the VisList should be clean in either method and it may work...

cyberkilla

I will try that:)

EDIT:
Well, to be honest, I still havent found out why it is doing this, but ive basically added the method to the bottom of paintComponent, and it is working.

I think it might be because im moving the camera into place for every frame.
That is costly, and stupid of me anyway :wink:

Thanks Egon! By the way, I should have some working vertex warping tonight!:)
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG

EgonOlsen

Didn't it work with the modified synchronization or haven't you tried it?

cyberkilla

I didnt try it the way you speak of, but I did disable all painting of the components, thereby preventing multiple threads using the vislist.

I believe it was more about the camera being in a different position when I checked it outside painting.
Since I moved the cameras in the painting thread(albeit foolishly), the position was corrected before the test with calling the method from there(which worked).
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG

EgonOlsen

Understood. But you would have run into threading problems anyway with the former approach (maybe quite subtle ones, but anyway), so it's a good thing(tm) that you are now avoiding them before they occur... :wink:

cyberkilla

Yes, indeed:)

I did try synchronizing the world, and cameras, but, because that wasnt the problem in this case, I removed them:P

It's working great now!
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG