Hi there,
I am fairly new to ruby (and this forum) and am trying to get a 3dconnexion-3dmouse to rotate selected objects.
I thought it would be a good idea to capture the view-changes and redirect it to object(s).
That would make the code generic for all input devices.
In my attempts I found some restrictions where you pro's may have some solutions for:
Question 1:
The observers are triggered after the change event.
so, Viewobserver.onViewChanged passes a modified view. In fact, the screen seems also already refreshed!
So, I can get the Camera.eye, .target and .up values to set the drawingobject's transformations,
and, I can create a new Camera object to reset the view to it's original, but it will
show a 'glitch' on screen.
What raises the following questions:
Are there a tricks to create:
a- Observer.BeforeViewChanged as opposed to Observer.AfterViewChanged although it (wrongly) is called Observer.OnViewChanged
So that one can do;
def Observer.BeforeViewChanged(oProposedNewView)
if oProposedNewView.Camera.eye.x > @nTheValueThatIreallyLike
return oProposedNewView
else
return @oAdifferentViewThatILikeMuchBetter
end
end
-or-
b- View.freeze or View.Lock or View.Lockstate, something to disable and enable the screen-refresh?
-or-
c- Acces- and Assign methods? so that one can create constructions as:
Camera.eye.assign(oNewsetting)
Camera.eye = oNewsetting ;
if oNewsetting.x > @nTheValueThatIreallyLike
end
-or/and-
Camera.eye.access(oNewsetting)
Camera.eye.x = @nThexthatIreallylike
return Camera.eye
end
Hmmm, Maybe a lot of questions for a first post...
Regards,
Reind