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