
PDE Download: Test02cPtsBary.pde
JAVA Download: Test02cPtsBary.java
Click on anar+ terms to get the documentation.
import processing.opengl.*;
import anar.*;
/*
* Example for Anar library by Guillaume LaBelle + Julien Nembrini
* http://anar.ch
*/
Pts myPts = new Pts();
Pts myOtherPts = new Pts();
Pts myBaryTri = new Pts();
Pts myBaryQuad = new Pts();
void setup(){
size(800,400,OPENGL);
Anar.init(this);
initForm();
Pts.globalRender = new RenderPtsAll();
}
void initForm(){
// Pt a = Anar.Pt(-50,-50, 40);
// Pt b = Anar.Pt(-50, 50, -40);
// Pt c = Anar.Pt( 50, 50, 0);
// Pt d = Anar.Pt( 50,-50, -10);
Pt a = Anar.Pt( -50, -50);
Pt b = Anar.Pt( -50,50);
Pt c = Anar.Pt(50,50);
Pt d = Anar.Pt(50, -50);
myPts.add(a);
myPts.add(b);
myPts.add(c);
myBaryTri.add(new PtBary(myPts));
float[] w = {.333f, .333f, .333f};
myBaryTri.add(new PtBary(myPts,w));
float[] ww = {.5f, .25f, .25f};
myBaryTri.add(new PtBary(myPts,ww));
myOtherPts.addPointsFrom(myPts);
myOtherPts.add(d);
myBaryQuad.add(new PtBary(myOtherPts));
float[] wOther = {1, .25f, .25f, .25f};
// float[] wOther = { .25f, .25f, .25f, .25f };
myBaryQuad.add(new PtBary(myOtherPts,wOther));
myBaryQuad.pt(1).parentList();
}
void draw(){
background(153);
myOtherPts.draw();
// myBaryTri.draw();
myBaryQuad.draw();
}

|