Plotting 3D array as a 'cloud' [message #77809] |
Sun, 09 October 2011 14:22  |
Robin Wilson
Messages: 40 Registered: August 2010
|
Member |
|
|
Hi all,
I've got a 3D array in IDL that contains a model of a cloud - that is,
each cell is either 0 (not cloud) or 1 (cloud). I'd like to plot this in
a 3D way, so that it looks like a cloud. I'm not quite sure how else to
describe it - but I'd like to be able to see the cloud as a 3D model -
so it just looks like a cloud shaped 'blob' - if possible one that can
be rotated.
I'm not quite sure how to go about this. I don't want to do a surface
plot - because I want all sides of the cloud not just the top surface. I
guess some sort of 3D point plot would be ok, but I want to see the
cloud as a solid blob, not as points with gaps between them.
I'm a little confused by the range of IDL procedures which can be used
to plot things like this, and am not really sure which is best to try
and use.
Any suggestions?
Cheers,
Robin
------------------
Robin Wilson
A PhD student studying complexity in remote sensing
www.rtwilson.com/academic
|
|
|
Re: Plotting 3D array as a 'cloud' [message #77952 is a reply to message #77809] |
Sat, 15 October 2011 05:14  |
Robin Wilson
Messages: 40 Registered: August 2010
|
Member |
|
|
Mark,
That seems like the easiest way of doing it - I've just managed to
produce the sort of output that I wanted.
I never knew about the xvolume tool - now it's definitely one for me to
keep in mind.
Cheers,
Robin
On 10/10/2011 20:26, Mark Piper wrote:
> On 10/10/2011 11:48 AM, Karl wrote:
>>
>> Using ISOSURFACE to generate polygon data for an IDLgrPolygon to
>> display with XOBJVIEW is an excellent first step. This will give you a
>> surface representing the transition between "cloud" and "no cloud".
>> ISOSURFACE can generate a lot of triangles, so consider using
>> MESH_DECIMATE to simplify the model if it is too much to display.
>>
>> This surface is usually displayed as an opaque surface, so you won't
>> see any structure "inside" the cloud, as there might be if there are
>> any "no cloud" regions within the outermost exterior surface. You can
>> sort of "zoom through" the outer surface, but you'll soon get lost. It
>> may be tempting to use alpha to draw the surface semi-transparently,
>> but this usually requires that the triangles be sorted back-to-front,
>> and that's a complicated job.
>>
>> Consider using IDLgrVolume with XOBJVIEW. IDLgrVolume can render the
>> volume data using "ray-casting" which will display your data
>> semi-transparently and handle the back-to-front issues.
>>
>> Is the iVolume iTool still around? If so, give that a try. You'll see
>> your volume rendered the same way as IDLgrVolume shows it. But you can
>> also drag "slice" planes through it. And I think you can turn on
>> isosurface generation as well.
>>
>> Karl
>>
>
> Following Karl's suggestion, you may also wish to try XVOLUME; e.g.,:
>
> IDL> vol = randomn(1, 100, 100, 100) gt 0.0
> IDL> xvolume, vol
>
> It's simpler than iVolume, yet provides similar features.
>
> mp
|
|
|
Re: Plotting 3D array as a 'cloud' [message #78004 is a reply to message #77809] |
Mon, 10 October 2011 12:26  |
Mark Piper
Messages: 198 Registered: December 2009
|
Senior Member |
|
|
On 10/10/2011 11:48 AM, Karl wrote:
>
> Using ISOSURFACE to generate polygon data for an IDLgrPolygon to display with XOBJVIEW is an excellent first step. This will give you a surface representing the transition between "cloud" and "no cloud". ISOSURFACE can generate a lot of triangles, so consider using MESH_DECIMATE to simplify the model if it is too much to display.
>
> This surface is usually displayed as an opaque surface, so you won't see any structure "inside" the cloud, as there might be if there are any "no cloud" regions within the outermost exterior surface. You can sort of "zoom through" the outer surface, but you'll soon get lost. It may be tempting to use alpha to draw the surface semi-transparently, but this usually requires that the triangles be sorted back-to-front, and that's a complicated job.
>
> Consider using IDLgrVolume with XOBJVIEW. IDLgrVolume can render the volume data using "ray-casting" which will display your data semi-transparently and handle the back-to-front issues.
>
> Is the iVolume iTool still around? If so, give that a try. You'll see your volume rendered the same way as IDLgrVolume shows it. But you can also drag "slice" planes through it. And I think you can turn on isosurface generation as well.
>
> Karl
>
Following Karl's suggestion, you may also wish to try XVOLUME; e.g.,:
IDL> vol = randomn(1, 100, 100, 100) gt 0.0
IDL> xvolume, vol
It's simpler than iVolume, yet provides similar features.
mp
|
|
|
Re: Plotting 3D array as a 'cloud' [message #78005 is a reply to message #77809] |
Mon, 10 October 2011 10:48  |
Karl[1]
Messages: 79 Registered: October 2005
|
Member |
|
|
On Sunday, October 9, 2011 10:10:24 PM UTC-6, Mike Galloy wrote:
> Robin Wilson <ro...@rtwilson.com> wrote:
>> Hi all,
>>
>> I've got a 3D array in IDL that contains a model of a cloud - that is,
>> each cell is either 0 (not cloud) or 1 (cloud). I'd like to plot this in
>> a 3D way, so that it looks like a cloud. I'm not quite sure how else to
>> describe it - but I'd like to be able to see the cloud as a 3D model - so
>> it just looks like a cloud shaped 'blob' - if possible one that can be rotated.
>>
>> I'm not quite sure how to go about this. I don't want to do a surface
>> plot - because I want all sides of the cloud not just the top surface. I
>> guess some sort of 3D point plot would be ok, but I want to see the cloud
>> as a solid blob, not as points with gaps between them.
>>
>> I'm a little confused by the range of IDL procedures which can be used to
>> plot things like this, and am not really sure which is best to try and use.
>>
>> Any suggestions?
>
> I would suggest using ISOSURFACE to get vertices and connectivity. Then
> create an IDLgrPolygon from that (or use function graphics). Use XOBJVIEW
> to display if you don't want to create your own object graphics hierarchy.
>
> Mike
> --
> www.michaelgalloy.com Research Mathematician Tech-X Corporation
Using ISOSURFACE to generate polygon data for an IDLgrPolygon to display with XOBJVIEW is an excellent first step. This will give you a surface representing the transition between "cloud" and "no cloud". ISOSURFACE can generate a lot of triangles, so consider using MESH_DECIMATE to simplify the model if it is too much to display.
This surface is usually displayed as an opaque surface, so you won't see any structure "inside" the cloud, as there might be if there are any "no cloud" regions within the outermost exterior surface. You can sort of "zoom through" the outer surface, but you'll soon get lost. It may be tempting to use alpha to draw the surface semi-transparently, but this usually requires that the triangles be sorted back-to-front, and that's a complicated job.
Consider using IDLgrVolume with XOBJVIEW. IDLgrVolume can render the volume data using "ray-casting" which will display your data semi-transparently and handle the back-to-front issues.
Is the iVolume iTool still around? If so, give that a try. You'll see your volume rendered the same way as IDLgrVolume shows it. But you can also drag "slice" planes through it. And I think you can turn on isosurface generation as well.
Karl
|
|
|
Re: Plotting 3D array as a 'cloud' [message #78006 is a reply to message #77809] |
Sun, 09 October 2011 21:10  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
Robin Wilson <robin@rtwilson.com> wrote:
> Hi all,
>
> I've got a 3D array in IDL that contains a model of a cloud - that is,
> each cell is either 0 (not cloud) or 1 (cloud). I'd like to plot this in
> a 3D way, so that it looks like a cloud. I'm not quite sure how else to
> describe it - but I'd like to be able to see the cloud as a 3D model - so
> it just looks like a cloud shaped 'blob' - if possible one that can be rotated.
>
> I'm not quite sure how to go about this. I don't want to do a surface
> plot - because I want all sides of the cloud not just the top surface. I
> guess some sort of 3D point plot would be ok, but I want to see the cloud
> as a solid blob, not as points with gaps between them.
>
> I'm a little confused by the range of IDL procedures which can be used to
> plot things like this, and am not really sure which is best to try and use.
>
> Any suggestions?
I would suggest using ISOSURFACE to get vertices and connectivity. Then
create an IDLgrPolygon from that (or use function graphics). Use XOBJVIEW
to display if you don't want to create your own object graphics hierarchy.
Mike
--
www.michaelgalloy.com Research Mathematician Tech-X Corporation
|
|
|
Re: Plotting 3D array as a 'cloud' [message #78007 is a reply to message #77809] |
Sun, 09 October 2011 17:57  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Robin Wilson writes:
> I've got a 3D array in IDL that contains a model of a cloud - that is,
> each cell is either 0 (not cloud) or 1 (cloud). I'd like to plot this in
> a 3D way, so that it looks like a cloud. I'm not quite sure how else to
> describe it - but I'd like to be able to see the cloud as a 3D model -
> so it just looks like a cloud shaped 'blob' - if possible one that can
> be rotated.
>
> I'm not quite sure how to go about this. I don't want to do a surface
> plot - because I want all sides of the cloud not just the top surface. I
> guess some sort of 3D point plot would be ok, but I want to see the
> cloud as a solid blob, not as points with gaps between them.
>
> I'm a little confused by the range of IDL procedures which can be used
> to plot things like this, and am not really sure which is best to try
> and use.
I would try a 3D scatter plot first. Depending on how
many points you have, the code here might be pretty slow.
There might be some ways to speed it up, if we knew
more about the problem.
http://www.idlcoyote.com/tips/scatter3d.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
|
|
|
Re: Plotting 3D array as a 'cloud' [message #78008 is a reply to message #77809] |
Sun, 09 October 2011 17:41  |
Matt Francis
Messages: 94 Registered: May 2010
|
Member |
|
|
I'm not sure about IDL, I have never used it in this way, but you may
be interested in S2plot http://astronomy.swin.edu.au/s2plot if IDl
proves to not have the features you are after.
On Oct 10, 8:22 am, Robin Wilson <ro...@rtwilson.com> wrote:
> Hi all,
>
> I've got a 3D array in IDL that contains a model of a cloud - that is,
> each cell is either 0 (not cloud) or 1 (cloud). I'd like to plot this in
> a 3D way, so that it looks like a cloud. I'm not quite sure how else to
> describe it - but I'd like to be able to see the cloud as a 3D model -
> so it just looks like a cloud shaped 'blob' - if possible one that can
> be rotated.
>
> I'm not quite sure how to go about this. I don't want to do a surface
> plot - because I want all sides of the cloud not just the top surface. I
> guess some sort of 3D point plot would be ok, but I want to see the
> cloud as a solid blob, not as points with gaps between them.
>
> I'm a little confused by the range of IDL procedures which can be used
> to plot things like this, and am not really sure which is best to try
> and use.
>
> Any suggestions?
>
> Cheers,
>
> Robin
>
> ------------------
> Robin Wilson
> A PhD student studying complexity in remote sensingwww.rtwilson.com/academic
|
|
|