Polygon primitive

  ... discussions about development with the GLES2 branch of AndEngine.

Re: Polygon primitive

Postby RealMayo » Wed Mar 07, 2012 2:24 am

RealMayo wrote:Hi Rodrigo,
I finally had a chance to play with your PolygonExample and it is awesome!
But I have a problem... when I copy that example code into my own project, the image does not repeat inside the TexturedPolygon. Instead the image stretches to fit the TexturedPolygon :( Do you have any idea why this is happening?

Ok this is weird, now I changed the vertex values to make a slightly different shape, and now the repeating texture works :?
User avatar
RealMayo
 
Posts: 1683
Joined: Sat Sep 03, 2011 9:25 pm
Location: Chicago, IL

Re: Polygon primitive

Postby recastrodiaz » Wed Mar 07, 2012 5:00 pm

RealMayo wrote:Ok this is weird, now I changed the vertex values to make a slightly different shape, and now the repeating texture works :?

Good to know it is working. Let me know if you encounter any bugs.
recastrodiaz
 
Posts: 26
Joined: Mon Aug 22, 2011 11:32 pm
Location: Lyon, France

Re: Polygon primitive

Postby OzLark » Sat Mar 10, 2012 5:13 am

Hi Guys,

This looks excellent - it looks like it can handle convex and concave polygons - is that the case?

What do you do about matching bodies to the polygons? I'm still stuck trying to convert non convex polys to create bodies..

Do you think this will make it into the main branch (soon?) I've modified my andengine a bit but would like to try this out...
Did this post help you? Feel free to return the gesture by downloading Ninja Bees, creating a level (or more) and sharing it to the Ninja Bees website!

Ninja Bees - Our latest Android game, check it out on Google Play (free) or paid with no ads
OzLark
 
Posts: 1130
Joined: Sun Feb 05, 2012 3:19 am

Re: Polygon primitive

Postby RealMayo » Sat Mar 10, 2012 5:23 am

Hi OzLark,
Yes this is amazing but it only makes sprites. Its up to you to match them up with bodies. Nevertheless it allows you to make repeating texture concave and convex sprites which is awesome!
If you want to make a concave polygon body, then you should create several fixtures attached to a body. Then attach this repeating texture concave sprite to that multi-fixture concave body.

Another advantage to using recastrodiaz branch of GLES2 is then you get to use Box2dDebugDraw ;)
User avatar
RealMayo
 
Posts: 1683
Joined: Sat Sep 03, 2011 9:25 pm
Location: Chicago, IL

Re: Polygon primitive

Postby OzLark » Sat Mar 10, 2012 3:27 pm

I'm already using debug draw (geeee that's saved me some time!!!) (thanks!!)..

Perhaps I should give this branch a go..... I really could use textured polys..... hmmmmm.
Did this post help you? Feel free to return the gesture by downloading Ninja Bees, creating a level (or more) and sharing it to the Ninja Bees website!

Ninja Bees - Our latest Android game, check it out on Google Play (free) or paid with no ads
OzLark
 
Posts: 1130
Joined: Sun Feb 05, 2012 3:19 am

Re: Polygon primitive

Postby OzLark » Tue Mar 13, 2012 7:24 am

I'm trying to merge the recastrodiaz polygon additions into my code base but I can't see how to get around the circular dependency between Andengine and the Box2D extension..

Any hints?
Did this post help you? Feel free to return the gesture by downloading Ninja Bees, creating a level (or more) and sharing it to the Ninja Bees website!

Ninja Bees - Our latest Android game, check it out on Google Play (free) or paid with no ads
OzLark
 
Posts: 1130
Joined: Sun Feb 05, 2012 3:19 am

Re: Polygon primitive

Postby OzLark » Tue Mar 13, 2012 9:38 am

Ok, I got recastrodiaz's changes merged in (thanks recastrodiaz) and it works perfectly! This makes making a lot of things a lot more simple.

I had to copy the box2d library (jar file) to the andengine project to avoid a project circular dependency - how is it meant to be done?
Did this post help you? Feel free to return the gesture by downloading Ninja Bees, creating a level (or more) and sharing it to the Ninja Bees website!

Ninja Bees - Our latest Android game, check it out on Google Play (free) or paid with no ads
OzLark
 
Posts: 1130
Joined: Sun Feb 05, 2012 3:19 am

Re: Polygon primitive

Postby RealMayo » Tue Mar 13, 2012 7:23 pm

Yes the circular dependency sucks. Its just how recastrodiaz decided to implement it. The way I accommodated it was by looking at all the import errors and then copy/paste the (3) necessary individual java files from within the box2dExtension to the AndengineExtension.
User avatar
RealMayo
 
Posts: 1683
Joined: Sat Sep 03, 2011 9:25 pm
Location: Chicago, IL

Re: Polygon primitive

Postby recastrodiaz » Wed Mar 14, 2012 2:32 pm

Concerning the circular dependency, I believe I simply added the Box2D extension to AndEngine's classpath :

<classpathentry kind="src" path="/AndEnginePhysicsBox2DExtension"/>

I didn't had to copy any java or jar files.
recastrodiaz
 
Posts: 26
Joined: Mon Aug 22, 2011 11:32 pm
Location: Lyon, France

Re: Polygon primitive

Postby RealMayo » Wed Mar 14, 2012 3:49 pm

Innocent question... Wouldn't it be better to implement it as an Andengine Extension?
User avatar
RealMayo
 
Posts: 1683
Joined: Sat Sep 03, 2011 9:25 pm
Location: Chicago, IL

PreviousNext

Return to GLES2

Who is online

Users browsing this forum: apenzzi, bruno.gabriel, Google [Bot] and 44 guests