Re: Delaunay and Java3D

Hi Desiree,

> x,y amd z are the Java3D Axes
> 
> these are the following values I have to assigne them, that they are
> displayed correctly in my reality:
> 
> x -> my "Rechtswert" = "rightvalue" = somewhere around 340000m
> y -> my height somewhere around 179m
> -z -> my "Hochwert" = "heightvalue" = somewhere around 540000m
> 
> thats because, when I want to display terrain, it should look like in
> reality, so x is going to the right of my screen, y is going inside the
> screen, and the height z is going up.

In Java3D with an identity projection matrix you should have
x increasing to the right, y increasing upward and z increasing
out of the screen (toward the viewer).  This is consistent with
your directions, with a 90 degree rotation in the matrix.

> So  I tried to change the coordinate-values of y and z the following way:
> 
> Geometry geom = shape3d.getGeometry();
>                         if (geom instanceof GeometryArray) {
>                             System.out.println("GeometryArray");
>                             GeometryArray geomarr = (GeometryArray) geom;
>                             Point3d[] point3d = new Point3d[18];
>                             for (int i=0;i<point3d.length;i++) {
>                                 point3d[i]= new Point3d();
>                             }
>                             geomarr.getCoordinates(0,point3d);
>                             double help;
>                             for (int i=0;i<point3d.length;i++) {
>                                 System.out.println("ausgabe");
>                                 help = point3d[i].y;
>                                 point3d[i].y=point3d[i].z;
>                                 point3d[i].z=-help;
>                                 System.out.println(point3d[i].x);
>                                 System.out.println(point3d[i].y);
>                                 System.out.println(point3d[i].z);
>                             }
>                             geomarr.setCoordinates(0,point3d);
>                             System.out.println("ulx "+ulx+"lrx "+lrx+"lry
> "+lry+"uly "+uly+"lz "+lz+"uz "+uz);
>                         }
>                         Shape3D terrain = new Shape3D();
> 
> But unfortunately there must be a mistake somewhere, because the Shape3D I
> am seeing after this, looks somewhat odd and not right triangulated.
> Is it possible to change the coordinates that way?
> I thought there would be no difference for the actual Shape3D, because I
> do have to do the 2-D-Triangulation with the 540000(x from
> Gauss-Krueger-Coordinates Geodesy) and
> 340000(y from Gauss-Krueger-Coordinates Geodesy) values. And after this
> just assigning the right height-values to the triangulation.
> Changing the Assignment of the axes for the coordinates afterwards should
> not influence the triangulation, as I thought. Maybe I am wrong?

You are right, swapping coordinates will not change the
triangulation.

I cannot see any error in what you are doing, but often face
similar mysteries in my own work.  All you can do is experiment
with different permutations and print out a lot of numbers,
trying to understand the relation with the picture, until you
solve it.

Good luck,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html