Author Topic: PickPolygon reporting nothing  (Read 7325 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11749
    • View Profile
    • http://www.jpct.net
PickPolygon reporting nothing
« Reply #15 on: February 09, 2007, 02:22:27 pm »
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...

Offline cyberkilla

  • float
  • ****
  • Posts: 413
    • View Profile
    • http://futurerp.net
PickPolygon reporting nothing
« Reply #16 on: February 09, 2007, 02:23:43 pm »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11749
    • View Profile
    • http://www.jpct.net
PickPolygon reporting nothing
« Reply #17 on: February 09, 2007, 03:04:55 pm »
Didn't it work with the modified synchronization or haven't you tried it?

Offline cyberkilla

  • float
  • ****
  • Posts: 413
    • View Profile
    • http://futurerp.net
PickPolygon reporting nothing
« Reply #18 on: February 09, 2007, 03:32:06 pm »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11749
    • View Profile
    • http://www.jpct.net
PickPolygon reporting nothing
« Reply #19 on: February 09, 2007, 03:42:23 pm »
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:

Offline cyberkilla

  • float
  • ****
  • Posts: 413
    • View Profile
    • http://futurerp.net
PickPolygon reporting nothing
« Reply #20 on: February 09, 2007, 03:47:25 pm »
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