Re: LineStripArray

Hi Doug,

> How do I create a VisADLineStripArray? I have a list of coordinates and
> I want a shape that connects the dots. I have used a VisADLineArray but
> I have to list each coordinate twice:
> 
> shape.coordinates = new float[] {x1,y1,z1, x2,y2,z2,
>                                  x2,y2,z2, x3,y3,z3};
> 
> Will a VisADLineStripArray allow me to do something like
> 
> shape.coordinates = new float[] {x1,y1,z1, x2,y2,z2, x3,y3,z3};
> 
> and if so, what should I use for vertexCount?
> 
> When I do the latter with vertexCount = 3, I get an error:
> 
> java.lang.NullPointerException:
> . . .

Did you fill in VisADLineStripArray.stripVertexCounts?  Like this:

  ((VisADLineStripArray) array).stripVertexCounts = new int[1];
  ((VisADLineStripArray) array).stripVertexCounts[0] = array.vertexCount;

If there is more than one strip in the array (i.e., lift the pen
between strips) then the values in stripVertexCounts should sum
to vertexCount.

Please let me know if this does not solve your problem.

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

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