0

I created a rectangle polygon like this:

polyrect=new Polygon(new float[]{0,0,width,0,width,height,0,height});
polyrect.setOrigin(width,0);
polyrect.setRotation(45f);
polyrect.setPosition(getX(),getY());
shapeRenderer.polygon(polySwatter.getTransformedVertices());

It worked well but now I want to draw an inverted triangle like this.

enter image description here

How can I draw an inverted triangle by this method?

Abhishek Aryan
  • 19,936
  • 8
  • 46
  • 65
Niranjana
  • 514
  • 5
  • 23

1 Answers1

2

You can set vertices in this way, that gives you inverted triangle.

polyrect=new Polygon(new float[]{width/2f,0,width,height,0,height});
polyrect.setOrigin(width,0);
//polyrect.setRotation(45f);
polyrect.setPosition(200,200);
Abhishek Aryan
  • 19,936
  • 8
  • 46
  • 65