SHARE
TWEET

Untitled

a guest Dec 8th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void renderShape(PVector[] vertices, color c, boolean fill){
  2.    if (fill) {
  3.       fill(c);
  4.     } else noFill();
  5.    
  6.     //Rand der unteren Fläche zeichnen/berechnen
  7.     PVector[] untererRand = new PVector[baseSegmente];
  8.     for(int i = 0;i<untererRand.length;i++){
  9.       untererRand[i] = vertices[i+1];
  10.     }
  11.    
  12.     //Rand der oberen Fläche
  13.     PVector[] obererRand = new PVector[baseSegmente];
  14.     for(int i = 0;i<obererRand.length;i++){
  15.       //Für den oberen Rand werden die Punkte vom Ende des Vertices-Array betrachtet
  16.       obererRand[i] = vertices[(vertices.length-(baseSegmente+1)+i)];
  17.     }
  18.     drawFan(vertices[0], untererRand);
  19.     drawFan(vertices[vertices.length - 1], obererRand);
  20.  
  21.  
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top