We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › noob problem with camera refresh
Page Index Toggle Pages: 1
noob problem with camera refresh (Read 145 times)
noob problem with camera refresh
Oct 28th, 2008, 4:30am
 
hi

I have a sketch in 3d which - due to my lack of understanding - is leaving trails of objects on the screen as they move upon each loop of the draw function. I am using the OCD camera library and sliders as well which are the device that is controlling the positioning of the moving objects.

I am looking for something that might clear the screen between draw loops so that when I make a change it appears as though the object itself has moved.

here's my draw function:
void draw(){
 background(224);
 camera1.feed();
 setupGrid();
 g = buildAnimalGraph();

if (g != null) {
   g.draw();  
 }
 smooth();
}

and

Graph buildAnimalGraph() {
 int maxAnimals = 1000;

 animalValuesTable = new Table("animalValues-06.txt");
 weightedEdgesTable = new Table("weightexperiment-02.txt");
 rowCountAVT = animalValuesTable.getRowCount();
 rowCountWET = weightedEdgesTable.getRowCount();
 
  for (int row = 1; row < rowCountAVT; row++) {
    float weight = animalValuesTable.getFloat(row,1);
    String diet = animalValuesTable.getString(row,15);
    String climate = animalValuesTable.getString(row,4);
    String common = animalValuesTable.getString(row,0);
    String special = animalValuesTable.getString(row,10);

   Node temp = new Node(weight, diet, climate, common, special);
   g.addNode(temp);
}

 for (int row=1; row<rowCountWET-2100; row++) {
   String source = weightedEdgesTable.getString(row,0);
   String target = weightedEdgesTable.getString(row,1);
   float weight = weightedEdgesTable.getFloat(row,2);  
 }
 return g;
}
Page Index Toggle Pages: 1