HI,
I've written the code to perform rotation. I used IDLgrModel->Rotate
property. But it doesn't do what i need to. Can anybody tell me why
this is happening and what should i do to obtain a 3D rotation of the
image.
Thanks for any help.
Cheers,
Akhila.
P.S: Code attached.
;----------------------------------------------------------- --------------
PRO rotation_event, event
Widget_Control, event.top, Get_UValue = state
state.oWindow -> Draw, state.oView
END
;----------------------------------------------------------- --------------
PRO rotateleft_event, event
Widget_Control, event.top, Get_UValue = info
info.oModel->rotate, [1,0,0], 5
info.oWindow -> Draw, info.oView
Widget_Control, event.top, Set_UValue = info, /No_Copy
END
;----------------------------------------------------------- --------------
PRO rotation
filename = FILEPATH(Subdirectory = ['examples', 'data'], 'head.dat')
OPENR, lun, filename, /GET_LUN
data = BYTARR(80,100,57)
READU, lun, data
FREE_LUN,lun
SHADE_VOLUME, data, 50, v, p, /LOW, /VERBOSE
SCALE3, XRANGE = [0,80], YRANGE = [0,100], ZRANGE = [0,57]
image = POLYSHADE(v,p, /T3D)
xsize = 512
ysize = 512
tlb = Widget_Base(Title='Image Window/Leveling Example', Column=1,
MBar=menuID, Base_Align_Center=1)
trb = Widget_base(tlb, /Row)
Button7 = Widget_Button(trb, VALUE = 'Rotate Left', UVALUE =
'rotateleft', Event_Pro = 'rotateleft_event')
drawID = Widget_Draw(tlb, XSize=xsize, YSize=ysize, /BUTTON_EVENTS,
/EXPOSE_EVENTS, retain = 0, GRAPHICS_LEVEL = 2)
Widget_Control, tlb, /Realize
Widget_Control, drawID, Get_Value=oWindow
sclimage = Bytscl(image, Min = displayMin, Max = displayMax)
oImage = Obj_New('IDLgrImage', image)
oView = Obj_New('IDLgrView', VIEWPLANE_RECT = [0,0,512,512], COLOR =
[0,0,0], PROJECTION = 2)
oModel = Obj_New('IDLgrModel')
oModel -> Add, oImage
oView -> Add, oModel
oWindow -> Draw, oView
info = { oModel:oModel, $
oView:oView, $
oWindow:oWindow}
Widget_Control, tlb, Set_UValue=info, /No_Copy
XManager, 'rotation', tlb, /No_Block
END
;----------------------------------------------------------- ------------
|