comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Setting IDLgrPolyline vertex colours?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Setting IDLgrPolyline vertex colours? [message #14283] Tue, 16 February 1999 00:00
dEdmundson is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Is a point in a 4 vertex polygon?
Next Topic: Re: Non-Blocking I/O

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:39:53 PDT 2025

Total time taken to generate the page: 0.00519 seconds