NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
Hi Lak, First, do not call clearMaps() and then add all the ScalarMaps every time you add new Data to the Display. Instead, make all your addMap() calls once at the begining, then to add new Data just call addReference(). Second, I suspect that your cones are becomming flat because they are at different ranges of Z values. When there is just one cone, the autoscaling for Z values does a setRange() for the Z ScalarMap that just covers the small range of Z values of that one cone. But the second cone may be at a very different range of Z values, so the autoscaling algorithm sets a much greater range of Z values to cover both cones and they become very flat. I see your application enables axis scales. Check whether you are getting a much greater range of Z values with multiple calls. Good luck, Bill ---------------------------------------------------------- Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI 53706 hibbard@xxxxxxxxxxxxxxxxx 608-263-4427 fax: 608-263-6738 http://www.ssec.wisc.edu/~billh/vis.html On Fri, 23 Aug 2002, V. Lakshmanan wrote: > > I get strange behaviour when I try to add two > cones to the display. > The first cone shows up just fine, but when > the second cone is added, the display > shows the two cones parallel to the xy plane. > (This is with Bill's texture mapping fix; > With the release version of visad.jar, I get > an OutOfMemoryError) > > http://www.nssl.noaa.gov/~lakshman/visad/3d_to_2d.html > > The problem is probably in the way I am adding > the ElevationScans to the display (I'm clearing > out the data references, then re-adding them): > > display.removeAllReferences(); > display.clearMaps(); > display.addMap( new ScalarMap( dr.x, Display.XAxis ) ); > display.addMap( new ScalarMap( dr.y, Display.YAxis ) ); > display.addMap( new ScalarMap( dr.z, Display.ZAxis ) ); > > for each drawable: > { > ScalarMap dataMap = new ScalarMap( gatevalue, > Display.RGBA ); > dataMap.setRange( myColorFunction.min, myColorFunction.max ); > display.addMap( dataMap ); > > // change the colormap from the default ... > ColorAlphaControl color = (ColorAlphaControl) > dataMap.getControl(); > color.setTable( myColorFunction.colorTable ); > } > > > for each drawable{ > display.addReference( data ); > } > > > Is there a better way? Is what I am doing wrong? > > thanks > Lak > >
visad
archives: