CS 453/553 -- Spring Quarter 2019

Project #5: Vector Cloud with Range Sliders

100 Points

Due: May 8


This page was last updated: April 24, 2019


Requirements:

  1. Put this project number and your name in the title bar.

  2. Create a 3D array of node points, evenly spaced within the range:

    -1.0 ≤ x,y,z ≤ 1.0

    The number of divisions you use in this region is up to you. You might want to parametrize this with "#defines" or "const ints".

  3. Compute a 3D vector at each node point according to the following formulas for the X, Y, and Z components of the velocity:

    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 function 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 );
    

  4. Show the extent of the volume by drawing the edges of the cube.

  5. Show the field using a vector cloud to represent the vector values at uniformly-distributed points around the volume. Scale the arrows to make the scene as legible as possible.

  6. Color code the vectors according to their length (ie, the speed of the field at that point). The color scale is up to you.

  7. Compute the curl of these vectors.
  8. A function to compute the curl is:

    float
    CurlFunc( float x, float y, float z )
    {
            float dvxdy = 3.*y*y*z + z*z*z;
            float dvxdz = 3.*y*z*z + y*y*y;
            float dvydx = 3.*x*x*z + z*z*z;
            float dvydz = 3.*x*z*z + x*x*x;
            float dvzdx = 3.*x*x*y + y*y*y;
            float dvzdy = 3.*x*y*y + x*x*x;
    
            float cx = dvzdy - dvydz;
            float cy = dvxdz - dvzdx;
            float cz = dvydx - dvxdy;
    
            return sqrt( cx*cx + cy*cy + cz*cz );
    }
    

  9. Use range sliders to identify regions where vector speed and curl are within certain ranges.

  10. Display an X-Y-Z set of axes as a reference. Allow these to be toggled on and off.

Suggestions:

Grading:

Item Points
Correct arrow cloud display 25
Arrow cloud scaling 25
Range slider to show vector speed 25
Range slider to show vector curl 25
Potential Total 100

Where In The World Did That Equation Come From?

The equation being used for this project describes flow through a solenoid.