【问题标题】:Polygon shape rendering in LibGdxLibGdx 中的多边形形状渲染
【发布时间】:2017-04-06 11:13:00
【问题描述】:

我创建了一个这样的矩形多边形:

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());

效果很好,但现在我想画一个像这样的倒三角形。


如何用这种方法画出倒三角形?

【问题讨论】:

  • 倒三角形是什么意思?
  • 添加图片@AbhishekAryan

标签: libgdx polygon shape-rendering


【解决方案1】:

您可以通过这种方式设置顶点,从而得到倒三角形。

polyrect=new Polygon(new float[]{width/2f,0,width,height,0,height});
polyrect.setOrigin(width,0);
//polyrect.setRotation(45f);
polyrect.setPosition(200,200);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-01
    • 2016-02-23
    • 2012-02-05
    • 1970-01-01
    • 2012-07-07
    • 1970-01-01
    相关资源
    最近更新 更多