Hi, Best thanks for your answers and solutions! Now I got the vertices.... to be able to sort them in a Grid-Like structure I decided the using of a TreeSet and implement a Comparator, which will not work in that way.
may anybody of you know how to make point3f comparable?
I got a hint from another list to override class Point3f and implement Comparable
public float[][] getDGMkoten(Point3f[] dgm){
LinkedHashSet xyz=new LinkedHashSet() ; //TreeSet xyz=new TreeSet(new ReversePoint3fComparator()); <- currently I try this way... xyz.addAll(Arrays.asList(dgm)); int gr=xyz.size();
Object[] objxyz=xyz.toArray(); float[][] vertxyz=new float[gr][3]; Point3f[] allpkt=new Point3f[gr]; for(int i=0;i<vertxyz.length;i++){ Point3f pktxyz=(Point3f)objxyz[i]; allpkt[i]=pktxyz; } //Arrays.sort(allpkt); -> this only works if Point3f knows method compareTo return allpkt; }
seems to be a solution to override Point3f
public class Point3D extendsTuple3f implements Comparable(){
Point3f(final float x, final float y, final float z){ this.x = x; this.y = y; this.z = z; }
public int compareTo(final Object o){ // checkCompare-code... } }
further hints are welcome ! bets regards rolf
=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".