[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

Discuss the Slick 2D Library
It is currently Mon Apr 06, 2020 3:19 am

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Tue Nov 20, 2012 12:35 am 
Offline

Joined: Mon Nov 19, 2012 10:53 pm
Posts: 7
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!


Top
 Profile  
 
PostPosted: Wed Nov 21, 2012 6:09 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482
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


Top
 Profile  
 
PostPosted: Wed Nov 21, 2012 7:51 pm 
Offline

Joined: Mon Nov 19, 2012 10:53 pm
Posts: 7
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


Top
 Profile  
 
PostPosted: Fri Jan 04, 2013 1:18 am 
Offline

Joined: Mon Nov 19, 2012 10:53 pm
Posts: 7
It would be very difficult to implement poly2tri triangulator in Slick? It would solve all my problems :D


Top
 Profile  
 
PostPosted: Sat Jan 05, 2013 1:19 am 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482


Top
 Profile  
 
PostPosted: Sat Jan 05, 2013 12:35 pm 
Offline

Joined: Mon Nov 19, 2012 10:53 pm
Posts: 7
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


Top
 Profile  
 
PostPosted: Sun Jan 06, 2013 12:35 am 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482


Top
 Profile  
 
PostPosted: Sun Jan 06, 2013 1:59 pm 
Offline

Joined: Mon Nov 19, 2012 10:53 pm
Posts: 7
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)


Top
 Profile  
 
PostPosted: Mon Jan 07, 2013 3:52 am 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482
That problem also exists in Slick... :wink:


Top
 Profile  
 
PostPosted: Mon Jan 07, 2013 12:13 pm 
Offline

Joined: Mon Nov 19, 2012 10:53 pm
Posts: 7
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)


Top
 Profile  
 
PostPosted: Tue Jan 08, 2013 4:51 pm 
Offline

Joined: Mon Nov 19, 2012 10:53 pm
Posts: 7
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!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group