Beginner question


I'm trying to display a field of data samples (x,y)->z in 3D, pretty much
like the tutorial section 4. My field is a bit bigger, not unrealistically
big though: 365 x 100 samples.

When I try to render this, some of the peaks are missing. It seems to me
like the renderer constructs the surface using only every n-th data point
from my field and interpolates the rest (although actual values would
exist). This assumption is supported by the program below which fills the
field with random data: If every peak was drawn correctly no peak would have
several colour patches in it.

How can I get every peak drawn? (Btw iso-contour map achieves this, but
limits me in other respects).

Thanks for your help


Sample program (contains some unnecessary code, please ignore that):

 VisAD Tutorial
 Copyright (C) 2000 Ugo Taddei

package tutorial.s4;

// Import needed classes

import java.awt.*;
import java.rmi.*;
import java.sql.*;

import javax.swing.*;

import com.dtecht.server.database.*;

import visad.*;
import visad.java3d.*;
import visad.util.*;

 * VisAD Tutorial example 4_01 Like example 4_02 but using a ContourWidget
 * have the functions altitude = h(latitude, longitude) temperature
 * f(latitude, longitude)
 * represented by the MathType ( (latitude, longitude) -> (altitude,
temperature ) )
 * Map the altitude to ZAxis and temperature to RGB Run program with "java
 * P4_02"

public class P4_02_1 {

        // The ContourWidget
        public P4_02_1(String[] args) throws RemoteException,
                        SQLException {

                RealType day = //RealType.getRealType("day");// 

                RealType age = RealType.getRealType("age",SI.meter,null);

                RealTupleType domain_tuple = new RealTupleType(day, age);

                RealType stddev
                RealType avg = RealType.getRealType("avg",SI.meter,null);

                RealTupleType range_tuple = new RealTupleType(avg, stddev);

                // Create a FunctionType (domain_tuple -> range_tuple )
                // Use FunctionType(MathType domain, MathType range)

                FunctionType func_domain_range = new
FunctionType(domain_tuple, range_tuple);

                int NCOLS = 100;
                int NROWS = 365;

                float[][] flat_samples = new float[2][NCOLS * NROWS];

                for(int i=0; i< NCOLS*NROWS;i++) {
                        flat_samples[0][i]= (float) Math.random();  
                        flat_samples[1][i]= flat_samples[0][i];
                // Create Display and its maps

                // A 2D display

                DisplayImplJ3D display = new DisplayImplJ3D("display1");

                // Get display's graphics mode control and draw scales

                GraphicsModeControl dispGMC = (GraphicsModeControl) display

                // Create the ScalarMaps: latitude to YAxis, longitude to
XAxis and
                // altitude to ZAxis and temperature to RGB
                // Use ScalarMap(ScalarType scalar, DisplayRealType

                ScalarMap latMap = new ScalarMap(day, Display.YAxis);
                ScalarMap lonMap = new ScalarMap(age, Display.XAxis);

                // Add maps to display


                // altitude to z-axis and temperature to color

                ScalarMap altZMap = new ScalarMap(avg, Display.ZAxis);

                ScalarMap tempRGBMap = new ScalarMap(stddev, Display.RGB);

                Set domain_set = new Integer2DSet(domain_tuple, NROWS,
        //      Set domain_set = new Linear2DSet(domain_tuple, 0, 364,
NROWS, 0, 99, NCOLS);
                FlatField vals_ff = new FlatField(func_domain_range,

                // ...and put the values above into it

                // Note the argument false, meaning that the array won't be

                vals_ff.setSamples(flat_samples, false);                
                // Create a data reference and set the FlatField as our data
                DataReferenceImpl data_ref = new


                // Add reference to display


                // Create application window and add display to window

                JFrame jframe = new JFrame("VisAD Tutorial example 4_02");
                jframe.getContentPane().setLayout(new BorderLayout());

                jframe.setSize(1200, 800);


        public static void main(String[] args) throws RemoteException,
VisADException {
                try {
                        new P4_02_1(args);
                } catch (SQLException e) {
                        // TODO Auto-generated catch block

} // end of Visad Tutorial Program 4_01

Carsten Friedrich
Dtecht Pty Limited
Suite 1303, 33 Bligh Street, Sydney NSW 2000
Tel: +61 2 9220 8204   
Fax: +61 2 9238 0044

Dtecht Pty Ltd - Confidential Communication The information contained in
this e-mail is confidential.  It is intended solely for the addressee. If
you receive this e-mail by mistake please promptly inform us by reply e-mail
and then delete the e-mail and destroy any printed copy. You must not
disclose or use in any way the information in the e-mail. There is no
warranty that this e-mail is error or virus free. It may be a private
communication, and if so, does not represent the views of Dtecht and its

To unsubscribe visad, visit: