This page was last updated: January 29, 2009
The number of divisions you use in this region is up to you. You might want to parametrize this with "#defines" or "const ints".
Vx(x,y,z) = y * z * ( y2 + z2 )
Vy(x,y,z) = x * z * ( x2 + z2 )
Vz(x,y,z) = x * y * ( x2 + y2 )
A C routine to do this is:
void
Vector( float x, float y, float z, float *vxp, float *vyp, float *vzp )
{
*vxp = y * z * ( y*y + z*z );
*vyp = x * z * ( x*x + z*z );
*vzp = x * y * ( x*x + y*y );
}
So that its calling sequence would be:
float x, y, z;
float vx, vy, vz;
. . .
Vector( x, y, z, &vx, &vy, &vz );
(The sample program uses 3 GLUI Translate-XY widgets to allow translation in XY, XZ, and YZ. Spinners would work too.)
void Arrow( float [3], float [3] ); . . . float tail[3], head[3]; . . . Arrow( tail, head );
The 3D arrow is drawn entirely with calls to glBegin(GL_LINE_STRIP), glVertex3f(), and glEnd(), so the appearance of the arrow will be governed by the current transformation matrix, the current line color, and the current line width.
This is like line tracing, but instead of having a line of points coming from the probe, have a 3D shape start there and deform. Advect each vertex in the object and then reconnect them as they were originally connected. This is an animation method, so the idle function (Animate( ) in the sample code) will be used to change something and force a redisplay.
| Item | Points |
| Correct arrows | 20 |
| Correct streamlines | 20 |
| Correct streamline probe | 20 |
| Correct ribbon probe | 20 |
| Correct line trace probe | 20 |
| Blob Probe EC | 10 |
| Potential Total | 110 |
The equation being used for this project describes flow through a solenoid.