Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

OpenGL vertex color interpolation mode

$
0
0
I seem to recall reading about and trying an OpenGL method to get a more blended, softer look between vertex colors on irregular shapes. It seems like it was something simple like a single method to switch modes, but now I'm having trouble finding anything like that. Does anyone maybe know about something like this? Here is an example of the standard mode for testing:

  1. import processing.opengl.*;
    
    PVector[] test;
    
    void setup() {
      size(400,400,OPENGL);
      colorMode(HSB);
      noStroke();
      
      test = new PVector[] {
        new PVector(1955,1754),
        new PVector(1925,1871),
        new PVector(2042,2054),
        new PVector(2000,2250),
        new PVector(1858,2495),
        new PVector(1517,2525),
        new PVector(1262,2432),
        new PVector(1268,2060),
        new PVector(1529,2126),
        new PVector(1676,1856),
        new PVector(1880,1622)};
      
      pushMatrix();
      translate(-300,-430);
      beginShape();
      for(PVector cur : test) {
        fill(random(255),255,255);
        cur.mult(.3);
        vertex(cur.x, cur.y);
      }
      endShape(CLOSE);
      popMatrix();
    }
    
    


Viewing all articles
Browse latest Browse all 1768

Trending Articles