Re: Same DataObject, 2 cameras ?

the maximum size that you see is probably
a function of the graphics card's texture
memory.

The only way around this problem is to
split the textures into manageable chunks.

Lak


On Wednesday 25 September 2002 03:19 am, Nicolas Ocquidant wrote:
> Hello,
>
> * Is it possible to share the same DataObject but have different
>
> cameras, color palette....
>
> I haven't seen such an example in the Example directory.
>
> * I have a strange behavior when I try to draw a simple 2D example,
>
> using java3d.TwoDDisplayRendererJ3D... When I specify a size
> greater
>
> than 500 * 500 (nx = 500, ny = 500), I only see a grey square. But
> for
>
> size < than 500 * 500, all works fine. I have no memory
> exception...
>
> Perhaps it is a system problem (Linux+ATI Radeon).
>
> Here is my code:
>
> ------------
>
> import visad.*;
> import visad.java3d.DisplayImplJ3D;
>
> import visad.java3d.TwoDDisplayRendererJ3D;
> import java.rmi.RemoteException;
> import javax.swing.*;
>
> public class Test2
> {
>    private RealType row;
>    private RealType col;
>    private RealType pixel;
>
>    private RealTupleType domainTuple;
>
>    private FunctionType funcDomPix;
>
>    private Set domainSet;
>
>    private FlatField valsFF;
>    private DataReferenceImpl dataRef;
>
>    private DisplayImpl display;
>
>    private ScalarMap rowMap;
>    private ScalarMap colMap;
>    private ScalarMap pixMap;
>
>    public Test2()
>     throws RemoteException, VisADException
>    {
>       row = new RealType("ROW");
>       col = new RealType("COLUMN");
>
>       domainTuple = new RealTupleType(row, col);
>
>       pixel = new RealType("PIXEL");
>
>       funcDomPix = new FunctionType(domainTuple, pixel);
>
>       ////////////////////////////////////////////////
>
>       // NX AND NY DECLARATION
>
>       // NX < 500 && NY < 500 : OK
>
>       // FOR GREATER VALUES, I ONLY SEE A GREY SQUARE???
>
>       // ---------------------
>
>       int ncols = 1000;
>       int nrows = 1000;
>
>       /////////////////////////////////////////////////
>
>       domainSet = new Integer2DSet(domainTuple, nrows, ncols);
>
>       float[][] flatSamples = new float[1][];
>
>       flatSamples[0] = buildSamples(ncols, nrows); // just return a
> float array...
>
>       valsFF = new FlatField(funcDomPix, domainSet);
>       valsFF.setSamples(flatSamples);
>
>       display = new DisplayImplJ3D("display1", new
> TwoDDisplayRendererJ3D());
>
>       GraphicsModeControl gmc = (GraphicsModeControl)
> display.getGraphicsModeControl(); gmc.setScaleEnable(true);
>
>       colMap = new ScalarMap(col, Display.XAxis);
>       rowMap = new ScalarMap(row, Display.YAxis);
>       colMap.getAxisScale().setScreenBased(true);
>       rowMap.getAxisScale().setScreenBased(true);
>
>       pixMap = new ScalarMap(pixel, Display.RGB);
>
>       display.addMap(colMap);
>       display.addMap(rowMap);
>       display.addMap(pixMap);
>
>       dataRef = new DataReferenceImpl("data_ref");
>       dataRef.setData(valsFF);
>
>       display.addReference(dataRef);
>
>       JFrame frame = new JFrame("VisAD test");
>       frame.getContentPane().add(display.getComponent());
>
>       frame.setSize(640, 480);
>       frame.setVisible(true);
>    }
>
> ------------
>
> Thanks a lot.
>
> Nicolas


  • 2002 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: