I am new to Java3D I am trying to read in a text File that contains x,y and z coordinates. I want to put them into a point Array. How do I get the points from the file so they are displayed on the scene. This is what I tried.
StringTokenizer st = new StringTokenizer(line);
time = Double.valueOf(st.nextToken()).doubleValue();
x = Double.valueOf(st.nextToken()).doubleValue();
y = Double.valueOf(st.nextToken()).doubleValue();
z = Double.valueOf(st.nextToken()).doubleValue();
PointArray par = new PointArray(vertexCount, vertexFormat);
Point3d[] pts1 = new Point3d[1];
pts1[0] = new Point3d(x,y,z);
Color3f[] co= {new Color3f(1.0f,0.0f,0.0f), new Color3f(1.0f,0.3f,0.5f),new Color3f(0.8f,0.3f,0.9f)};
par.setCoordinates(0,pts1);
par.setColors(0,co);
//System.out.println(time+ ", "+x);
this.addGeometry(par);
but it didn’t work. I would appreciate any assistance available.