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

Home » Public Forums » archive » Re: isurface with custom palette
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: isurface with custom palette [message #69289 is a reply to message #69273] Mon, 11 January 2010 09:53 Go to previous messageGo to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Jan 11, 2:34 pm, gg <qonq...@googlemail.com> wrote:
> I would like to visualize elevation data with iSurface tool using
> following vector for levels
> levels =
> [-1000,1,25,50,100,150,250,350,500,750,1000,1250,1500,1750,2 000,2500,3000]
> i.e. values lower than 1 with light blue color, then green for values
> between 1-25, and so on continuing with yellow, brown, up to value
> 3000, and white for values above. Below is the code which I am trying
> to use for that purpose, but it seems that I am missing something.
>
> pro topo3d
> device, decom=0
> rgb_table = bindgen(256,3)
> rgb_table[0:17,0]=
> [000,140,000,040,080,120,160,200,255,230,200,170,145,120,090 ,135,180,255]
> rgb_table[0:17,1]=
> [000,140,100,125,150,175,200,225,255,220,180,150,110,075,040 ,110,180,255]
> rgb_table[0:17,2]=
> [000,255,000,000,000,000,000,000,000,000,000,000,000,000,000 ,090,180,255]
> levels =
> [-1000,1,25,50,100,150,250,350,500,750,1000,1250,1500,1750,2 000,2500,3000]
> data = hanning(200,200)*3000
> isurface, data, RGB_TABLE=rgb_table,texture_image=bytscl(data),
> vert_colors=levels
> end
>
> Could you please be so kind and provide me some hints how to produce
> figure with surface using custom palette for various levels?

One way is to replace your isurface line with

data_colors=value_locate(levels,data)
isurface,data,rgb_table=rgb_table,vert_colors=data_colors

The vert_colors must contain either the RGB triples, or the indexes
into the given colortable of each vertex. Since you already provide
the colortable through the rgb_table keyword, it is easier to provide
the indexes in vert_colors. You were passing levels, which was being
interpreted as a set of colortable indexes, that was used cyclically
because it was smaller than the number of vertices.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: pointer & structure
Next Topic: Re: idlwave segfault

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

Current Time: Fri Oct 10 18:46:24 PDT 2025

Total time taken to generate the page: 1.04037 seconds