[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Slick Forums :: View topic - BUG: Filling a curved closed shape problems
Slick Forums
http://slick.ninjacave.com/forum/

BUG: Filling a curved closed shape problems
http://slick.ninjacave.com/forum/viewtopic.php?f=1&t=5870
Page 1 of 1

Author:  LosTChG [ Tue Nov 20, 2012 12:35 am ]
Post subject:  BUG: Filling a curved closed shape problems

Hello!

I've just finished porting a project from Java2D and, surprisingly, everything appears to work fine. The FPS have raised a lot since I use Slick2D, so thanks for giving birth/maintaining this library :D

However, I have found that when I g.fill a closed shape made of cubic curves, the filling always lacks of one triangle (the one between the last control point of the last curve and random points from the first curve), as you can see clearly in this image:



Does someone else have this problem? How could I solve this?

Looking forward to your responses, and thanks for all!

Author:  davedes [ Wed Nov 21, 2012 6:09 pm ]
Post subject:  Re: BUG: Filling a curved closed shape problems

It seems to be a bug with Slick's triangulator. I don't know enough about triangulation to try and debug it, unfortunately.

The suggestion I made in another thread was to use Java2D for primitive rendering. The fixed OpenGL pipeline is not ideal for 2D primitive rendering, anyways: some drivers don't support anti-aliasing of 2D shapes, some drivers use different pixel offsets, some drivers have limited line width support, etc. Since Java2D is a software renderer, these problems don't exist with it.

You can see an example of how to efficiently upload Java2D primitive shapes to Slick here:
viewtopic.php?p=31326#p31326

Author:  LosTChG [ Wed Nov 21, 2012 7:51 pm ]
Post subject:  Re: BUG: Filling a curved closed shape problems

Heh, davedes, you are everywhere, amazing!
Thanks for the info! I have just also visited one of my post you replied half a month in libgdx forums regarding primitive rendering too, and I should have read it earlier, because It would have saved me all the porting process to slick2d >_<
Baaack to libgdx :P

Author:  LosTChG [ Fri Jan 04, 2013 1:18 am ]
Post subject:  Re: BUG: Filling a curved closed shape problems

It would be very difficult to implement poly2tri triangulator in Slick? It would solve all my problems :D

Author:  davedes [ Sat Jan 05, 2013 1:19 am ]
Post subject:  Re: BUG: Filling a curved closed shape problems


Author:  LosTChG [ Sat Jan 05, 2013 12:35 pm ]
Post subject:  Re: BUG: Filling a curved closed shape problems

In libgdx you cannot set the stroke width, that's all.
I've seen that you also abandoned slick development, that's a pity :(
Thanks for the pseudocode, it seems easy, I'll try that before giving up.
Oh, and surprisingly I get more FPS in my shitty intro gamescreen with slick than with libgdx, using the same number of images o.o

Author:  davedes [ Sun Jan 06, 2013 12:35 am ]
Post subject:  Re: BUG: Filling a curved closed shape problems


Author:  LosTChG [ Sun Jan 06, 2013 1:59 pm ]
Post subject:  Re: BUG: Filling a curved closed shape problems

Also, libgdx can't fill a shape made of beziers (although that can be solved using the triangulator and a closed shape, but I can't find a shape class in libgdx API or something similar)

Author:  davedes [ Mon Jan 07, 2013 3:52 am ]
Post subject:  Re: BUG: Filling a curved closed shape problems

That problem also exists in Slick... :wink:

Author:  LosTChG [ Mon Jan 07, 2013 12:13 pm ]
Post subject:  Re: BUG: Filling a curved closed shape problems

Uhmm, maybe xD, but how do I get the segment points of the curves generated by shaperenderer in order to make an actual shape? (Which I pressume it is just an array of points in certain order)

Author:  LosTChG [ Tue Jan 08, 2013 4:51 pm ]
Post subject:  Re: BUG: Filling a curved closed shape problems

Nevermind, I've been researching about meshes and I think you're right: though difficult, at the end it will be a benefit to do it that way.
Thanks for all!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/