NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: problems with drawing points in 3d display

Hi Bader,

> how can i draw a specific points in any location i
> want in 3d display?
> is there a specific method to draw them by giving the
> (x,y,z) coordinates? if not,how to extend example 2_03
> in the tutorial to draw them in 3d display?

Yes, this wouldn't be too hard.  Modify:

  t_h_tuple = new RealTupleType( time, height);

to:

  RealType third = new RealType("third");
  t_h_tuple = new RealTupleType( time, height, third);

Modify:

  float[][] point_vals = new float[][]{{-3.0f, -1.5f, 0.0f, 1.5f, 3.0f,},
                                       {0.0f, 33.75f, 45.0f, 33.75f, 0.0f,} };

to:

  float[][] point_vals = new float[][]{{-3.0f, -1.5f, 0.0f, 1.5f, 3.0f,},
                                       {0.0f, 33.75f, 45.0f, 33.75f, 0.0f,},
                                       {0.0f, 1.0f, 2.0f, 3.0f, 4.0f,} };

Or put into point_vals whatever array of values you want to
display.

If you want to display more or less than 5 points you'll
need to modify:

  index_set = new Integer1DSet(index, 5);

Then modify:

  display = new DisplayImplJ2D("display1");

to:

  display = new DisplayImplJ3D("display1");

and add:

  ScalarMap thirdMap = new ScalarMap(third, DisplayZAxis);
  display.addMap( thirdMap );

That should do it.

Cheers,
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


  • 2000 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: