Editing
Vtk/SimpleCubeTutorial/CubeDetails
(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!
===Identifying the normal to each cube face=== * It is important to appreciate that, when identifying the POINTS that will define any individual POLYGON, the ''order in which the POINTS are identified matters.'' VTK will draw the perimeter of the polygon by connecting the points ''in the specified order.'' For example, the top face of the cube (POLYGON "1"), as illustrated above, has been properly drawn because the line of data defining that quadrilateral reads "4 4 5 6 7"; VTK understands that the perimeter of that desired polygon will be traversed by connecting POINT 4 to POINT 5 to POINT 6 to POINT 7, then ''back to POINT 4.'' The same desired result could be achieved by providing a line of data that reads "4 6 7 4 5," but the proper polygon would not have been drawn if the line of data read "4 5 7 6 4." * For visualization purposes, it is useful to catalog the orientation of the unit vector that is ''normal'' to the face of each polygon. (It is straightforward to make this identification because each defined polygon is assumed to be perfectly flat.<sup>1</sup>) But there will always be a ''sign'' ambiguity; is the unit vector pointing "up," or is it pointing "down." For example, POLYGON "1" in the above illustration — the face on the top of the cube — lies parallel to the ''x-y'' plane, so the unit vector that is normal to its surface points in the ''z-''direction. But is it pointing in the ''plus'' ''z-''direction or the "minus" ''z-''direction? In order to resolve this ambiguity, by default VTK uses the [http://en.wikipedia.org/wiki/Right-hand_rule right-hand rule] when assigning a NORMAL to each polygon. More specifically, as the POINTS are being connected ''in sequence'' to define each POLYGON, VTK assumes that it is traversing the polygon's perimeter in a counter-clockwise direction and that the unit normal points "up" as would be indicated by the direction that the thumb on your right hand points as the fingers on your right hand are also curling counter-clockwise. Hence, referring back to POLYGON "1" in our simple cube example, for which the relevant line of input data reads "4 4 5 6 7," VTK will record (internally) that the NORMAL to POLYGON "1" points in the ''plus z'' direction. Put another way, the unit vector that sits normal to POLYGON "1" points in the <math>~(x,y,z) = (0,0,1)</math> direction. * It is possible to override VTK's default specification of the NORMAL for any given POLYGON. Within the context of the ''Simple Legacy Format,'' this is done by explicitly assigning a triplet of integers (or floating point numbers) to every POLYGON as part of the "CELL_DATA" specification and under an optional "NORMALS" subcategory of the input data file. <sup>1</sup>This is certainly true for our illustrated cube and, I presume, it is VTK's default presumption. With this in mind, it is safest and easiest to build all structures using 3-sided polygons — that is, triangles — because the three POINTS that define each triangle are guaranteed to lie in the same plane.
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