Annonce

>>> Bienvenue sur codelab! >>> Première visite ? >>> quelques mots sur codelab //// une carte des membres//// (apéros) codelab


#1 2017-12-02 15:56:46 "local variable may not have been initialized"

Obra
nouveau membre
Date d'inscription: 2017-11-21
Messages: 7

"local variable may not have been initialized"



Bonjour petit probleme lors de l'execution du projet je vous laisse check

import toxi.geom.*;
import toxi.geom.mesh.*;
import toxi.processing.*;

int DIM=20;
float NOISE_SCALE=0.15;
String [] data;
ArrayList mesValeurs;
TriangleMesh mesh;
ToxiclibsSupport gfx;

void setup() {
  size(800, 800, P3D);
  Terrain terrain = new Terrain(DIM, DIM,20);
  // populate elevation data
mesValeurs = new ArrayList();
data =loadStrings("data/tableur_magique.csv");

for(int i=0; i<25; i++){
   String[] data = split(data[i], ';');
  float v = float(data[1]);
mesValeurs.add(v);
}
  float[] el = new float[DIM*DIM];
for(int z = 0, i=0; z<DIM; z++){
   for(int x= 0; x<DIM; x++){

//
// for(int i=0; i< data.length; i++){

// println(fields[1]);
 
  float  v = (float) mesValeurs.get(i);
  el[i++] = v;
 
// for (int z = int(fields[1]),e = 0; z < DIM; z++) {
   // for (int x= int(fields[2]); x < DIM; x++) {
    // el[e++] = noise(x * NOISE_SCALE, z * NOISE_SCALE) * 100;
    // el[e++] =
//}
  //}
}


//float x= float(fields[0]);
//float y= float(fields[1]);

  noiseSeed(10);

  terrain.setElevation(el);
  // create mesh
  mesh = new TriangleMesh();
  terrain.toMesh(mesh,-10);
  // attach drawing utils
  gfx = new ToxiclibsSupport(this);
}
}
void draw() {
  background(0);
  lights();
  translate(width/2,height/2,0);
  rotateX(mouseY*0.01);
  rotateY(mouseX*0.01);
  noStroke();
  gfx.mesh(mesh);
}

Hors ligne

 

#2 2017-12-02 15:57:53 Re : "local variable may not have been initialized"

Obra
nouveau membre
Date d'inscription: 2017-11-21
Messages: 7

Re: "local variable may not have been initialized"



voila le csv

Hors ligne

 

fil rss de cette discussion : rss

Pied de page des forums

Powered by FluxBB

codelab, graphisme & code : emoc / 2008-2024