# 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
>
>

```
• 2005 messages navigation, sorted by:
• Search the `visad` archives: