Yar

Sign in to follow this  
  • entries
    208
  • comments
    383
  • views
    65547

Floating point problems... solved!!

Sign in to follow this  
H_o_p_s

76 views

Try and try as I might, I could not get a pixel accurate area of a tile. I found out that this is becuase internally Java2D uses floating point coordinates for rendereing... So I found a work around by creating a whole bunch of rectangles. Rectangles in Java are handled with int, so by adding and subtracting a whole bunch of rectangles to the clipping area I was finally able to get the correct clipping working.


Now you might be asking youself: "Why would you wasnt to mask out the tiles? They don't even overlap!" And the answer is: You want to make sure that LATER when the verts are added that they are clipped out.

Also, my linux tester got ~450fps!
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now