In article <7ll5nu$787$1@nnrp1.deja.com>, shearerm@bp.com wrote:
> I have a 3d data array of the flame progression from some large scale
> tests. I wish to display iso-surfaces (i.e. the flame surface at a
> given
> time) from this data plus a certain amount of geometry and the
> locations
> of the instruments that produced the data. I then want to produce an
> animation of the development of the explosion.
>
> I know this all sounds fairly ambitious, especially since I am fairly
> new
> to IDL, but I can see how most of it can be achieved. The only problem
> I have is that I can not figure out how to generate the is-osurface as
> an object. (I have succeeded with the non object based commands)
>
> Can any one help?
I have a program to do something similar, but I haven't used it in quite a
while, so I confess that the details are no longer fresh in my mind.
(That's a polite way of saying that I don't remember how the hell this
thing works.)
SHADE_VOLUME, pvc, pv0, v, poly ;Find the pv0 isosurface
v(0L,*) = -1.0 + 2.0*v(0L,*)/n ;Scale the x-coordinates
of vertices
v(1L,*) = -1.0 + 2.0*v(1L,*)/n ;Scale the y-coordinates
of vertices
v(2L,*) = -1.0 + 2.0*v(2L,*)/nzz ;Scale the z-coordinates
of vertices
PRINT, MIN(v(0L,*)), MAX(v(0L,*))
PRINT, MIN(v(1L,*)), MAX(v(1L,*))
PRINT, MIN(v(2L,*)), MAX(v(2L,*))
HELP, v, poly
title = 'Test Window'
ni = 400L
nj = 400L
view = OBJ_NEW('IDLgrView', VIEWPLANE_RECT = [-1.0, -1.0, 2.0, 2.0], $
PROJECTION = 1L, ZCLIP = [1.0, -1.0])
model = OBJ_NEW('IDLgrModel') ;Create model to contain
surface
window = OBJ_NEW('IDLgrWindow', TITLE = title, $;Create (ni x nj) window
DIMENSIONS = [ni, nj])
trimesh = OBJ_NEW('IDLgrTessellator') ;Create object for tesselator
trimesh -> AddPolygon, v, POLYGON = poly
tess = trimesh -> Tessellate(v, poly)
OBJ_DESTROY, trimesh
HELP, v, poly
surface = OBJ_NEW('IDLgrPolygon', v, POLYGONS = poly, $ ;Create surface
COLOR = [255,255,255], STYLE = 2L, SHADING = 1L, REJECT = 0L)
model -> ADD, surface ;Add surface to model
lightmodel = OBJ_NEW('IDLgrModel') ;Create lighting model
fixedlight = OBJ_NEW('IDLgrLight', TYPE = 1, $ ;Create a fixed light
LOCATION = [-1,-1,1], COLOR = [128,128,128])
lightmodel -> ADD, fixedlight ;Add the fixed light to
its own model so the light will stay stationary
light = OBJ_NEW('IDLgrLight', TYPE = 2, $ ;Create movable light
that goes with surface
LOCATION = [-1,-1,-1])
model -> ADD, light ;Add a light to the main model
TVLCT, r, g, b, /GET ;Get existing palette
palette = OBJ_NEW('IDLgrPalette', r, g, b) ;Create palette object
window -> SETPROPERTY, PALETTE = palette ;Add palette to window
model -> SCALE, 0.9, 0.9, 0.9
model -> ROTATE, [1, 0, 0], 60.0
view -> ADD, model ;Add surface model to view
view -> ADD, lightmodel ;Add fixed light to view
window -> DRAW, view ;Draw view in window
STOP
OBJ_DESTROY, window ;Destroy window object
OBJ_DESTROY, view ;Destroy view object
|