Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: filled coloured triangles

Hi Mike,

Probably the easiest way to do this is to construct
for each triangle a FlatField with MathType:

  ((x, y, z) -> c)

and with domain Set an Irregular3DSet of the three
trianlge vertices, and to set the three FlatField
range values all to the color c of the triangle. Then
construct a FieldImpl with MathType:

  (index -> ((x, y, z) -> c))

and domain Set Integer1DSet(number_of_triangles). Then
display using ScalarMaps x -> XAxis, y -> YAxis,
z -> ZAxis and c -> RGB. See Ugo's tutorial for examples
of similar constructions.

Good luck,
Bill

On Tue, 7 Jun 2005, Mike Wang wrote:

> I've just started doing my project with VisAD a couple of months ago and
> I encountered a problem,
>
> I have a set of 3 points. Each point has its own x,y,z coordinates, and
> a fourth value, say c.
>
> The 3D data were stored in an array like this:
> float[][] cords = {
> {x11,y11,z11,x12,y12,z12,x13,y13,z13},
> {x21,y21,z21,x22,y22,z22,x23,y23,z23},
> .
> .
> .
> {xn1,yn1,zn1, xn2,yn2,zn2 , xn3,yn3,zn3 }};
>
> and c was stored in another array:  float[] c = {c1,c2,.cn}.
>
> I'd like to draw triangles with the grouped 3 points and fill it with
> colours of individual value c.
>
> Does anybody have idea about how to do this?
>
> Many thanks
>
> Mike
>
>


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690