Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: 3D Trajectories (beginner)

Hi Hugo,

To draw the trajectory as a curve in 3-D, you need a FlatField
with MathType ((x, y, z) -> time) and with domain Set that is a
Gridded3DSet with manifold dimension = 1.

Note that the VisuTraj.java program in the visad/examples
directory does something a lot like this, except:

1. It has multiple trajectories.
2. It uses Gridded3DSets with manifold dimension = 1 instead
   of FlatFields (these Gridded3DSets could be the domains of
   FlatFields if you needed time or some other dependent
   variables).
3. It animates trajectories, but does not color them.

Good luck,
Bill

On Thu, 17 Feb 2005, Hugo Heden wrote:

> Good day all!
>
> Just started trying VisAD out a few days ago, and I'm a little stuck..
>
> I can't figure out (from the tutorial, mailing list archives or other
> doc) how to plot a 3D-trajectory (using the VisAD-Java-libraries)
>
> time -> (x, y, z)
>
> Ideally I would want to animate the trajectory, or show the time by
> means of colors. (Also, I want to add a widget, to let the user control
> the time variable.) I have tried something like the code below, but that
> gives me the trajectory as (nicely colored) *points*, but I would want a
> *continuous* function.. I realize that there is something fundamental
> I've been missing here.. Could anyone point me in the right direction? I
> found an intresting mailing list post on
> http://my.unidata.ucar.edu/content/staff/russ/visad/msg01230.html , but
> I couldn't figure out how to implement that..
>
> Best regards
> Hugo Heden
>
>
>     // ....
>     RealTupleType rangeTupleType = new RealTupleType( xType, yType, zType );
>     RealType timeType = RealType.getRealType( timeString );
>     ScalarMap timeMap = new ScalarMap( timeType, Display.RGB );
>     display.addMap( timeMap );
>
>     FunctionType t_to_xyz_funcType = new FunctionType( timeType,
> rangeTupleType );
>
>     float[][] timeVals = new float[1][ timeValues.length ];
>     timeVals[0] = timeValues;
>     Set timeSet = new Gridded1DSet( timeType, timeVals, timeValues.length );
>     FlatField vals_ff_1 = new FlatField( t_to_xyz_funcType, timeSet );
>     // ....
>
>


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690