Skip to content

beginShape/endShape convert LINES shape to triangle fan in WEBGL. #2804

@LBdN

Description

@LBdN

Nature of issue?

  • Found a bug
  • Existing feature enhancement
  • New feature request

Most appropriate sub-area of p5.js?

  • Color
  • Core/Environment/Rendering
  • Data
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Other (specify if possible)

Which platform were you using when you encountered this?

  • Mobile/Tablet (touch devices)
  • Desktop/Laptop
  • Others (specify if possible)

Details about the bug:

  • p5.js version: 0.6.0
  • Web browser and version: chrome 65
  • Operating System: win10
  • Steps to reproduce this:

create a LINES shape :

        sketch.beginShape(sketch.LINES);
        for (var e of this.edgePool.values()) {
            sketch.vertex(e.x1, e.y1, 0);
            sketch.vertex(e.x2, e.y2, 0);            
        }
        sketch.endShape(sketch.CLOSE);     

see the triangle fan displayed instead.

Probably because those lines in p5.js code :

if (this.drawMode === constants.FILL || this.drawMode === constants.TEXTURE) {

the code converts the LINES shapes into a triangle fan.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions