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

Home » Public Forums » archive » Elevation Shading in Object Graphics
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: Elevation Shading [message #42239 is a reply to message #13351] Fri, 14 January 2005 08:53 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jim Harwell writes:

> I am using Dave Fanning's code to shade a 3D elevation.
>
> At present the elevations fade from:
> BLUE through GREEN through RED through YELLOW
>
> with the
> HIGHEST value represented as YELLOW, the
> LOWEST as BLUE and the
> MIDPOINT as RED.
>
> This always occurs regardless of the input values.
> i.e. if max & min are 255 and 0 respectively, they will be represented
> by yellow & blue respectively.
> likewise, if max & min are 155 and 55 respectively, they will be
> represented by yellow & blue respectively.
>
> What I want is that the output color correlates directly with the input
> value.
> i.e. if max & min are 255 and 0 respectively, they will be represented
> by yellow & blue respectively.
> but if max & min are 155 and 55 respectively, they will be represented
> by for instance red & green respectively.
>
> There must be some kind of scaling/normalization going on but I can't
> locate the code responsible - can anybody help me out/tell me where to
> correct it?
>
> This may be partly responsible:
> thisSurface = OBJ_NEW('IDLgrSurface', data, x, y, $
> Color=[255,255,255], _Extra=extra, Style=style, $
> Shading=shading, Hidden_Lines=hidden_lines)
> s = Size(data, /Dimensions)
> thisSurface->SetProperty, Vert_Colors=Reform(BytScl(data, /NAN),
> s[0]*s[1]), $
> Palette=thisPalette

Use the MAX and MIN values on the BYTSCL command to set the
scaling you desire:

theVertColors= BytScl(data, /NAN, MIN=55, MAX=155)
theVertColors= Reform(theVertColors, s[0]*s[1])
thisSurface -> SetProperty, Vert_Colors=theVertColors

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Question on watershed segmentation
Next Topic: How to use GTOPO30 in IDL?

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

Current Time: Fri Oct 10 02:29:07 PDT 2025

Total time taken to generate the page: 0.80063 seconds