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

Home » Public Forums » archive » 3D VOLUME VISUALIZATION
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: 3D VOLUME VISUALIZATION [message #42198 is a reply to message #42099] Mon, 03 January 2005 14:38 Go to previous messageGo to previous message
Karl Schultz is currently offline  Karl Schultz
Messages: 341
Registered: October 1999
Senior Member
"idle" <tangsk@astro.umass.edu> wrote in message
news:1104789321.046793.159050@f14g2000cwb.googlegroups.com.. .
>
> Antonio Santiago wrote:
>> idle wrote:
>>> Is there any way to make the volume transparent so one can see
> through
>>> the volume instead only the front plane? Thanks!
>>>
>>
>>
>> I supossing you are talking about IDLgrVolume. The RGB_TABLE0 is the
>> color table (256x3 array) for your DATA0 data and OPACITY_TABLE0 is
> the
>> opacity (256 array) for every element of the RGB_TABLE0 color table.
>> Then, for every color you can asign an opacity ("alpha channel").
>>
>> Bye.
>
> Thanks. I met another problem as I first deal with 3D visulation. I can
> show the data on the screen, but when I use OBJ_NEW('IDLgrClipboard')
> to try to save it to a file as postscript, the eps file is just a dark
> images.

It is documented that volume object won't render when using vector output.
While a volume object ultimately is rendered as a 2D image, and 2D images
can be rendered with vector output, IDL still does not render volumes in
vector output. This is because per-pixel depth information is maintained in
a volume object so that surfaces and other geometric primitives can be
rendered correctly with volume data on devices that have depth buffers.
Vector output cannot use depth buffering.

> By the way, how to save the image as a jpeg file?

You could render your scene into an IDLgrBuffer object, read the pixel data,
and then use WRITE_JPEG to create a jpeg file.


>
> following is part of the code to draw and save the image.
> ;----------------------------
>
> loadct,13
> tvlct, r, g, b,/get
> rgb=bytarr(256,3)
> rgb(*,0)=r & rgb(*,1)=g & rgb(*,2)=b
>
> myvolume = OBJ_NEW('IDLgrVolume', da)
> cc=[-0.5,1.0/64.0]
> myvolume->SetProperty,XCOORD_CONV=cc,YCOORD_CONV=cc,ZCOORD_CONV=cc
> mywindow = OBJ_NEW('IDLgrWindow',DIMENSIONS=[400,400])
> ;mywindow = OBJ_NEW('IDLgrClipboard')
>
> myview = OBJ_NEW('IDLgrView',VIEWPLANE_RECT=[-1,-1,2,2], $
> ZCLIP=[2.0,-2.0],color=[50,50,50])
> mymodel = OBJ_NEW('IDLgrModel')
> myview->Add,mymodel
> mymodel->Add,myvolume
> mymodel->rotate,[1,1,1],20
> opac = BYTARR(256)
> opac[0:127] = BINDGEN(128)/8
> myvolume->SetProperty,OPACITY_TABLE0=opac
> myvolume->SetProperty,RGB_TABLE0=rgb
> mywindow->Draw,myview
> ;mywindow->Draw,myview,VECTOR=1,POSTS=1,FILE='rgb.eps'
> ;mywindow->Draw,myview,VECTOR=0,POSTS=0,FILE='a.bmp'
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: xmargin and ymargin keywords ignored in cgplot
Next Topic: plotting missing values

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

Current Time: Wed Oct 08 18:20:02 PDT 2025

Total time taken to generate the page: 0.00263 seconds