This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

anar+

by   LaBelle + Nembrini
©2008

built with ( )
   examples index
Rotate: middle click or key[1]
Zoom in|out: wheel button or key[2]
AutoRotate: key[5]
(First Click inside the applet to enable keys)

This applet use OpenGL, you might have to install extra jogl libraries once to view this applet. You may have a look at image capture and video at the bottom of this page. You might accept security security permenently to remove the security prompts on each pages.



sourcecode


   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();
 
}
 
 
 



screenshots