samer@1: import samer.core.types.*; samer@1: import samer.maths.*; samer@1: import java.util.*; samer@1: import javax.media.j3d.*; samer@1: import javax.vecmath.*; samer@1: samer@1: samer@1: public class MatrixPointArray extends PointArray implements Observer samer@1: { samer@1: int N; // number of points samer@1: Matrix P; // 3d positions of points samer@1: VVector A; // scalar activations samer@1: VDouble K; // slaing factor for activations samer@1: float carray[]; // array for holding colours samer@1: samer@1: samer@1: public MatrixPointArray(Matrix points, VVector activities) samer@1: { samer@1: super(points.getRowDimension(), COORDINATES | COLOR_3); samer@1: samer@1: N=points.getRowDimension(); samer@1: P=points; samer@1: A=activities; samer@1: carray=new float[3*N]; samer@1: K=new VDouble("scale",1); samer@1: samer@1: // set capabilities for subsequent updates samer@1: setCapability(ALLOW_COORDINATE_WRITE); samer@1: setCapability(ALLOW_COLOR_WRITE); samer@1: samer@1: { samer@1: double [] a=A.array(); samer@1: for (int i=0; i