Re: [Fxruby-users] FXGLViewer#translate
Status: Inactive
Brought to you by:
lyle
|
From: Lyle J. <jl...@cf...> - 2003-06-18 14:56:12
|
Joel VanderWerf wrote:
>> I want to change the viewer's position, and #translate is what seems
>> to do it in Fox. At least, that's how right-click-and-drag is
>> implemented. But calling translate thru the FXRuby interface doesn't
>> seem to have any effect. Anyone know how to do this?
>
>
> Just to be more precise, I applied the following patch to glviewer.rb.
> The zoom changes, but not the viewer position.
FXGLViewer#create calls #setBounds, which in turn resets the model's
center to its original position (i.e. the center of the bounding box for
the model). So the effects of your call to FXGLViewer#translate are
wiped out before you get a chance to see them.
Try moving the call to #translate to some point *after* the window has
been created. As a quick hack to the glviewer.rb example program, try
replacing one of the menu item's callbacks with a call to translate, e.g.
openCmd.connect(SEL_COMMAND) {
viewer.translate(FXVec.new(2, 2, 2))
}
If you want the model to start out "translated", I suppose you can also
subclass FXGLViewer and override its #create method.
Hope this helps,
Lyle
|