|
From: Chris M. <ch...@ma...> - 2001-09-06 00:34:28
|
Greg Roelofs wrote: >... > Also, I think someone asked about "shooting" (picking) a day or two > ago. That's going to be needed for a sane Examine mode, too, since > you generally want rotation to occur about a point somewhere in the > object or part of the object that's in front of you, preferably close > to the center of the field of view. I remember Chris or someone > discussing the finer points of Cosmo's approach a few years ago... All Cosmo did was pick a point in the middle of the bbox and use that as the examine center. Then it was maintained through pan and zoom. The really cool thing about Cosmo's examine mode (which I have not seen duplicated anywhere else), is the manipulation interface. It used a manipulator from Inventor called a "SphereSheetProjector". This was a very nice class which would take the pick point and project it onto either a sphere or plane (sheet) depending on its distance from the center of rotation. Near the center of rotation, the object is manipulated as if your hand was on a sphere, very natural. But as you moved off the center, it became more and more as though you were dragging a piece of string along a flat surface (the sheet). The other end of this string was wrapped around the object, which spun along an axis perpendicular to the direction of drag as you moved away. It solves many of the problems of manipulation and makes for very repeatable results. It was very easy to grab the object examine all around it and then return it to its original orientation. This is something I have never seen in any of the other browsers. Since Inventor is now Open Source, perhaps someone can grab the SphereSheetProjector class and its friends. I believe it is called SbSphereSheetProjector, which means it is in the Basic subsystem of Inventor. You'll need several other classes from Basic as well. I ended up taking this class and trimming it down to just our needs. It allowed me to get rid of some of the bloat, but you can probably take them all to make it simpler. From what I remember, using it is pretty simple. You set the center of rotation, and the initial pick point. Then you give it an updated pick point and it returns a SbRotation. This is a quaternion based rotation value that can be easily converted into a SbMatrix, which is a simple 4x4 matrix contains just a rotation. I can help find it if needed... -- Chris Marrin | Senior Software Architect | Sony Corporation phone: (408) 955-3049 | cm...@ar... | | What is this talk of software 'releases'? Klingons do not 'release' | | software; our software ESCAPES, leaving a bloody trail of designers | | and quality assurance people in its wake! (unknown author) | |