/** * This example shows how to dynamically create a simple box mesh and align it * with a given direction vector using the pointTowards() method of the * TriangleMesh class. */ /* * Copyright (c) 2010 Karsten Schmidt * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * http://creativecommons.org/licenses/LGPL/2.1/ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ import processing.opengl.*; import toxi.geom.*; import toxi.geom.mesh.*; import toxi.processing.*; Vec3D BOX_SIZE = new Vec3D(5,5,50); float SCALE=200; TriangleMesh[] boxes=new TriangleMesh[600]; ToxiclibsSupport gfx; void setup() { size(600,600,OPENGL); gfx=new ToxiclibsSupport(this); for(int i=0; i