Skip to content

webgl: results dependend on order of stroke/fill calls #2509

Closed
@Spongman

Description

@Spongman

you get different results if you call fill() before stroke(), or visa-versa.

image

function setup() {
  createCanvas(windowWidth, windowHeight-4, WEBGL);
  strokeWeight(2);
}
function draw() {
  var t = millis();
  background(0);
  
  push();
  fill(255, 0, 0, 50);
  stroke(0, 255, 0, 50);
  
  translate(-100, 0, 0);
  rotateY(t/1000);
  rotateZ(t/1234);
  box();
  pop();
  
  push();
  stroke(0, 255, 0, 50);
  fill(255, 0, 0, 50);
  
  translate(100, 0, 0);
  rotateY(t/1000);
  rotateZ(t/1234);
  box();
  pop();
}

https://codepen.io/Spongman/pen/WdXabo?editors=0010

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