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

Home » Public Forums » archive » Re: Draped Contours?
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: Draped Contours? [message #68973 is a reply to message #68972] Thu, 10 December 2009 09:48 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 12/10/09 10:06 AM, JD Smith wrote:
> On Dec 9, 5:40 pm, David Fanning<n...@dfanning.com> wrote:
>> JD Smith writes:
>>> I was playing with iSurface (shocking, I know), and found very useful
>>> the ability to "drape" contours interactively on top of the surface,
>>> similar to raised relief maps with contour lines. It occurs to me I
>>> have no idea how to do this; probably some object graphics thing.
>>> Does anyone have a short example of forming such a draped contour? I
>>> did consider using the SHADES keyword for shade_surf to color various
>>> levels black, but I prefer lighting-based shading, and (ideally)
>>> vector contours for output.
>>
>> Can you give us a picture of what you mean, or at least
>> describe what you did with iSurface? I have an example
>> of a contour plot cutting through a surface at any
>> level. I have a feeling that program can be easily
>> adapted if I had a better idea of what you had in mind.
>
> This PDF shows such an example, in Fig. 8:
>
> http://www.ittvis.com/portals/0/tutorials/idl/Contours_and_S urfaces.pdf
>
> Here's another example:
>
> http://tir.astro.utoledo.edu/idl/draped_contours.png
>
> I did notice that even when exporting to EPS, the contours are
> bitmaps, so my SHADES idea might be a reasonable analog. Creating
> contours and dropping each one individually to the appropriate height
> on top of the surface must be doable with object graphics, but it's
> not immediately obvious to me.
>
> Thanks.
>
>
> P.S. Any OSX/XQuartz users recognize this error?
>
> IDLITWINDOW::DOHITTEST: Failure to acquire window rendering context.
> error: xp_attach_gl_context returned: 2
>
> I get it off and on with iTools and must restart IDL.
>

Like this?

z = randomu(seed, 50, 50)
for i = 0, 4 do z = smooth(z, 5, /edge_truncate)

view = obj_new('IDLgrView')

model = obj_new('IDLgrModel')
view->add, model

dem = obj_new('IDLgrSurface', z, style=2, color=[200, 200, 0],
depth_offset=1)
model->add, dem

contours = obj_new('IDLgrContour', z, n_levels=15)
model->add, contours

lightModel = obj_new('IDLgrModel')
view->add, lightModel

light = obj_new('IDLgrLight', type=2, location=[-1, 1, 1])
lightModel->add, light

ambientLight = obj_new('IDLgrLight', type=0, intensity=0.4)
lightModel->add, ambientLight

dem->getProperty, xrange=xr, yrange=yr, zrange=zr
xc = norm_coord(xr)
xc[0] -= 0.5
yc = norm_coord(yr)
yc[0] -= 0.5
zc = norm_coord(zr)
zc[0] -= 0.5
dem->setProperty, xcoord_conv=xc, ycoord_conv=yc, zcoord_conv=zc
contours->setProperty, xcoord_conv=xc, ycoord_conv=yc, zcoord_conv=zc

model->rotate, [1, 0, 0], -90
model->rotate, [0, 1, 0], -30
model->rotate, [1, 0, 0], 45

clipboard = obj_new('IDLgrClipboard', dimensions=[400, 400])
clipboard->draw, view, /postscript, /vector, filename='draped_surface.eps'

win = obj_new('IDLgrWindow', dimensions=[400, 400], graphics_tree=view)
win->draw

end

Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Reducing a set of curves to a mean curve
Next Topic: ITT VIS at the 90th AMS Annual Meeting

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

Current Time: Sat Oct 11 10:05:55 PDT 2025

Total time taken to generate the page: 0.46365 seconds