Setting IDLgrPolyline vertex colours? [message #14283] |
Tue, 16 February 1999 00:00 |
dEdmundson
Messages: 23 Registered: February 1998
|
Junior Member |
|
|
I am trying to assign colours to the vertices of a polyline
snaking through 3D space. I load a "rainbow" palette via
palette = obj_new('IDLgrPalette')
palette -> LoadCT, 33
and define my polyline object with
p = obj_new('IDLgrPolyline', x, y, z, shading=1)
Now, for each (x,y,z) triple I have a positive float in
a 1D array "data". I can map these floats to integer
indices into the palette's (apparent) range 0-255 via
scaleddata = fix(255*data/max(data))
Two questions:
1) How can I create the IDLgrPolyline's "vert_colors" array?
The getRGB function converts an integer index to an RGB
triple but won't handle "scaleddata" in one go.
2) Is there a simpler method of associating polyline colours
with an existing palette? I dislike my half-finished
solution because it assumes a 256 colour palette. (Aside:
Why does p->getproperty,n_colors=cols give cols=0 rather
than 255? Hence my assumption.)
Any help is much appreciated.
Cheers,
Darran.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
|
|
|