Hello,
I'm trying to write an interactive version of the procedure in David
Fannning's book that makes an iso-surface of a head (p. 125)
Anyway...
The compiler insist on reading my REPEAT BEGIN statement as an & END
statement.
Why?
the script is attached. I know it won't work yet, as the value returned from
the histogram isn't the right one, but that's a minor problem at the moment)
Chris
window, 1, xsize=400, ysize=400
head=loaddata(8)
s=size(head)
xs=s(1)-1
ys=s(2)-1
zs=s(3)-1
topcolor=!d.n_colors-1
histwindow=!d.window
Plot, Histogram(head), Max_Value=5000
window, 2, xsize=400, ysize=400
Empty
headwindow=!d.window
Shade_Volume, head, 50, vertices, polygons, /Low
Scale3, XRange=[0,xs], YRange=[0,ys], ZRange=[0,zs]
isosurface = PolyShade(vertices, polygons, /T3D)
LoadCT, 0, NColors=topColor+1
TV, isosurface
!Mouse.Button = 0
; get to right window
wset, histwindow
;create pixmap window and enter it
window, 3, /pixmap, xsize=400, ysize=400
tv, bytscl(histogram(head), top=topcolor-1)
pixwindow=!d.window
; return to the histogram
wset, histwindow
; Get initial cursor location. Draw cross-hair.
Cursor, col, row, /Device, /Down
PlotS, [col,col], [0,400], /Device, Color=topColor
print, col
; Loop.
REPEAT BEGIN
; Get new cursor location.
Cursor, colnew, rownew, /change, /Device
IF !mouse.button eq 1 then BEGIN
; Erase old cross-hair.
device, copy=[0,0,400,400,0,0,pixwindow]
; Draw new cross-hair.
print, col
col = colnew
row = rownew
ENDIF
IF !mouse.button eq 2 then BEGIN
; update head
;temporarily disabled
;wset, headwindow
;
;
;Shade_Volume, head, col, vertices, polygons, /Low
;isosurface = PolyShade(vertices, polygons, /T3D)
;TV, isosurface
;
;
;wset, histwindow
ENDIF
REP UNTIL !Mouse.Button eq 4
;Erase the final cross-hair.
wset, histwindow
device, copy=[0,0,400,400,0,0,pixwindow]
END
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
|