Editing
Vtk/Quadric
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Animation of Spinning Ellipsoid== Next, I wanted to construct [[vtk/MovieMaking#Making_a_Movie|an animation sequence]] of an ellipsoid that is spinning about its shortest axis. I also wanted to attach three colored "vectors" that are permanently aligned with the three principal axes of the ellipsoid; I did not think this would be difficult because, in connection with the [[vtk/SimpleCubeTutorial#Assigning_NORMALS_to_POLYGONS|''Simple Cube Tutorial'']], I had already developed a workflow that generates three such coordinate-identifying vectors. [As shown in the workflow, below, the linear "stem" of each coordinate-axis vector was constructed as a long, thin cylinder using vtkCylinderSource, and the crowning "arrowhead" of each was constructed using vtkConeSource.] My initial thought was that I could generate the desired "spin" by simply "rolling" the camera. More specifically, I thought I could use the parameter exploration feature in VisTrails to vary the "Roll" angle inside of the vtkCamera module. I quickly found out that this approach would work only if I pointed the camera down the z-axis. It would not work if I wanted to view the spinning ellipsoid from some other "azimuthal" angle, because then the vtkCamera's "Roll" axis does not coincide with the desired "spin" axis of the ellipsoid. After some thought, I realized that I needed, instead, to vary the "RotateZ" parameter inside of the vtkActor module … well, actually, this parameter would need to simultaneously be varied in ''all'' of the vtkActor modules. The VisQuad.vt workflow discussed above has two Actors — one handling the ellipsoidal contours and the other handling the bounding box — and an additional ''six'' Actors would be needed if I was going to simultaneously spin the coordinate-axis vectors. And the desire to spin those vectors posed a problem because, in the workflow that I originally constructed in order to build the vectors, I had already assigned values to the "RotateZ" parameter inside two vtkActor modules in order to properly align the "arrowhead" with the "stem" of two vectors. <table align="center" border="1"> <tr><th align="center" colspan="2">Figure 2: Pivoting Ellipsoid</th></tr> <tr> <td align="center"> [[File:WorkflowSpinningEllipsoid.png|400px|Spinning Ellipsoid Workflow]] </td> <td align="center"> [[File:SpinningEllipsoid01.gif|250px|Animation of Spinning Ellipsoid]] </td> </tr> </table> I accomplished all the desired tasks using the workflow shown immediately above, in the lefthand panel of Figure 2; the resulting animation is displayed to the right of the workflow image. Here are a couple of the key steps that were taken: * The vtkActors being used to generate the three coordinate-axis vectors were released from the responsibility of aligning the "arrowhead" with the "stem." To accomplish this, I inserted an additional pair of modules — one vtkTransform and one vtkTransformPolyDataFilter — into the subsets of the workflow (see the blue-bordered boxes in the Figure 2 workflow) that generates both the X-axis vector and the Y-axis vector. In both cases, the arrowhead-stem alignment is accomplished via this additional transformation step. * A "Float" module — named "SpinAngle" (see the Figure 2 workflow) — was added to the workflow to serve as the mechanism by which the ellipsoid's spin-angle is specified. The value of this floating-point variable is fed into all of the vtkActor modules and, in each, is identified as the assigned value of "RotateZ"; this was accomplished by adding an additional input port to each vtkActor module. * In the end, I decided not to feed the SpinAngle parameter value into the vtkActor module (a) that assists in defining the Z-coordinate axis vector, or (b) that assists in defining the bounding box. Because the ellipsoid is being spun about the Z-axis, the orientation of that axis is necessarily independent of SpinAngle; and, I thought that the animation looked better without spinning the bounding box.
Summary:
Please note that all contributions to JETohlineWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
JETohlineWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Tiled Menu
Table of Contents
Old (VisTrails) Cover
Appendices
Variables & Parameters
Key Equations
Special Functions
Permissions
Formats
References
lsuPhys
Ramblings
Uploaded Images
Originals
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information