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

Home » Public Forums » archive » Rotation of 3D image in Object Graphics
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Rotation of 3D image in Object Graphics [message #30262] Thu, 11 April 2002 16:47
idlfreak is currently offline  idlfreak
Messages: 47
Registered: October 2001
Member
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

;----------------------------------------------------------- ------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Examine "Saved" IDL procedures now too!
Next Topic: IDL5.5 XROI problem...

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

Current Time: Fri Oct 10 00:26:51 PDT 2025

Total time taken to generate the page: 0.80070 seconds