DOC PREVIEW
OSU CS 553 - Vector Visualization

This preview shows page 1-2 out of 6 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Vector VisualizationMike [email protected] – April 16, 2013Oregon State UniversityComputer GraphicsOregon State UniversityWhat is a Vector Visualization Problem?A vector has direction and magnitude. Typically science and engineering problems that work this way are those involving fluid flow through a velocity field.Whee !mjb – April 16, 2013Oregon State UniversityComputer GraphicsExamplesmjb – April 16, 2013Oregon State UniversityComputer Graphicshttp://mathforum.org/mathimages/index.php/Vector_Fieldshttp://www.physicsdaily.com/physics/Image:Vectorfield_jaredwf.pngChuck EvansIt Doesn’t Always Have to be Physical Flow:Things Like Magnetic Fields Count TooThis magnetic wand consists of a small bar magnet on a universal joint, and is a good way to give a physical fell to magnetic fields. (You can get these from Edmund Scientific.)mjb – April 16, 2013Oregon State UniversityComputer Graphicshttp://www.physics.sjsu.edu/becker/physics51/mag_field.htmTwo Types of Vector Visualization1. What does the field itself look like?2. What do things placed in the field do?mjb – April 16, 2013Oregon State UniversityComputer GraphicsWhat Does the Field Look Like? GlyphsThe most straightforward way to see what the field looks like is to place glyphs throughout the field. mjb – April 16, 2013Oregon State UniversityComputer GraphicsThe OpenDX AutoGlyphfunction gives you these type options:2RocketArrowNeedleOpenDX Vector Glyphsmjb – April 16, 2013Oregon State UniversityComputer GraphicsA Cool Wind Speed and Direction Glyphmjb – April 16, 2013Oregon State UniversityComputer GraphicsWolfgang BloemWhat Does the Field Look Like? Glyphs as Vector CloudsIn the same way that a point cloud was a simple way to visualize a scalar field, a Vector Cloud is a simple way to visualize a vector field. Go to selected points in the data volume, look up the velocity vector there (vx, vy, vz), and draw an arrow centered around that point. The arrow’s direction shows the direction of flow. The arrow’s length shows the magnitude of the velocity field (i.e., its speed).Nuance alert: the size of the arrow comes out in whatever units the velocity field is defined in, and might be too small to see or so large that it clutters the screen. You typically have to uniformly scale all the arrows to make the display useful.ddmjb – April 16, 2013Oregon State UniversityComputer GraphicsBadGoodDrawing an ArrowIt’s surprisingly involved to draw a good-looking 3D arrow. So, you’ve been given a C/C++ function to do it for you. Use it like this:float tail[3], head[3];. . .<< At the point (x,y,z) with a velocity there of (vx,vy,vz) >>tail[0] = x – Scale*vx/2.;tail[1] = y – Scale*vy/2.;tail[2] = z – Scale*vz/2.;hd[0] +Sl*/2mjb – April 16, 2013Oregon State UniversityComputer Graphicshead[0] = x + Scale*vx/2.;head[1] = y + Scale*vy/2.;head[2] = z + Scale*vz/2.;Arrow( tail, head );Arrow( ) uses OpenGL lines, so the current line width and current color can be set as usual:glLineWidth( w ); // number of pixels wide (floating point), ≥ 1.glColor3f( r, g, b ); // red, green, blue in the range 0.-1.Arrow( tail, head );The arrows also get transformed along with everything else.Turning it Into a Scalar Problem:Magnitude isosurfacesmjb – April 16, 2013Oregon State UniversityComputer GraphicsParticle AdvectionVector Clouds are OK, but we can do more. The next step is to think about what would happen if we released an imaginary massless ping-pong ball somewhere in the velocity field. Where would it go? This is called Particle Advection.?mjb – April 16, 2013Oregon State UniversityComputer Graphics?3Taking a First Order StepIf we are at Point A, and the velocity field is as shown, how do we know where we end up next?Easy, right? We look at the velocity field at Point A, and take a step in that direction, ending up at Point B. This is called a First Order Step. It is also sometimes called Euler’s Method.Bmjb – April 16, 2013Oregon State UniversityComputer GraphicsATaking a First Order StepvoidAdvect( float *x, float *y, float *z ){xa = *x; ya = *y; za = *z;GetVelocity( xa, ya, za, &vxa, &vya, &vza );xb = xa + TimeStep*vxa;yb = ya + TimeStep*vya;zb = za + TimeStep*vza;mjb – April 16, 2013Oregon State UniversityComputer Graphics*x = xb; *y = yb; *z = zb;}All is Not Right: the Spiral ProblemAssume we have a vector field that moves in a circle, that is:vx = - yvy = x(x, y)Now, take a First Order step, and you move like this:mjb – April 16, 2013Oregon State UniversityComputer GraphicsWhich puts you on a larger radius. The next First Order step puts you on an even larger radius. And so on, and so on. What should be circular motion has now become spiraling-out motion.All is Not Right with First OrderClearly something is not right. While we were taking that straight-line step, the velocity field was changing underneath us, and we weren’t taking it into account.Obviously, we could simply take smaller time steps, but that wouldn’t solve the problem, just make it smaller. And, in the process, it could take lots longer to compute.Bmjb – April 16, 2013Oregon State UniversityComputer GraphicsABTaking a Second Order StepBHere’s another approach. Let’s assume that the field change during the time step is linear so that the average velocity vector during the step is the average of the velocity vector at A and the velocity vector at B. You do this by adding up the individual x, y, and z components and dividing by 2:This is called a Second Order Step.And of course you can continue this way mjb – April 16, 2013Oregon State UniversityComputer GraphicsABAnd, of course, you can continue this way even more. Average the velocity vectors at A and C, take a step in that direction, and call it D.Average the velocity vectors at A and D, take a step in that direction, and call it E.CTaking a Second Order StepvoidAdvect( float *x, float *y, float *z ){xa = *x; ya = *y; za = *z;GetVelocity( xa, ya, za, &vxa, &vya, &vza );xb = xa + TimeStep*vxa;yb = ya + TimeStep*vya;zb = za + TimeStep*vza;mjb – April 16, 2013Oregon State UniversityComputer GraphicsGetVelocity( xb, yb, zb, &vxb, &vyb, &vzb );vx = ( vxa + vxb ) / 2.;vy = ( vya + vyb ) / 2.;vz = ( vza + vzb ) / 2.;xc = xa + TimeStep*vx;yc = ya + TimeStep*vy;zc = za + TimeStep*vz;*x = xc; *y = yc; *z = zc;}First Order Code4The World’s Largest Particle Advection Experiment mjb – April 16, 2013Oregon State UniversityComputer


View Full Document

OSU CS 553 - Vector Visualization

Download Vector Visualization
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Vector Visualization and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Vector Visualization 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?