Re: Need help in IDLgrSurface and vertical exaggeration [message #47895] |
Fri, 17 March 2006 09:31  |
David Streutker
Messages: 34 Registered: June 2005
|
Member |
|
|
I'm not sure about the depth perception/perspective issue, but my
(possibly incomplete) understanding of the vertical exaggeration is as
follows:
The scaling factor is set by the [XYZ]COORD_CONV keywords. Right now,
your horizontal scaling is:
1.0/(800*25) = 0.00005 (in inverse meters)
while your vertical scaling is:
1.0/3500 = 0.00029
The ratio of these two is about 5.7, which should be your vertical
exaggeration. In order to remove the exaggeration, the second element
of the [XYZ]COORD_CONV keywords needs to be consistent for all
dimensions.
-David
|
|
|
Re: Need help in IDLgrSurface and vertical exaggeration [message #47896 is a reply to message #47895] |
Fri, 17 March 2006 02:54   |
raval.chintan
Messages: 54 Registered: May 2005
|
Member |
|
|
Dear Rick,
I have been troubling you a lot for some time but belive me each
interaction (or encounter) with you has always been fruitful and
broadened by knowledge of IDL thank you for that
I have not been able to take time out to build the circuit but your
solution is terrific.
Anyways coming to the point, I am not using XOBJVIEW as you might have
suspected , instead I have been bolder and used IDLitWindow class along
with IDLgrSurface to create my own view the details are as follows:
I have used normalized coordinate system for creating the *system*
VIEWPLANE=[-0.5,-0.5,1,1]
ZCLIP=[-1,1]
EYE=1.01
Projection=2
Color = [20,50,75]
self.oSurfView = OBJ_NEW('IDLgrView', COLOR=Color,$
VIEWPLANE_RECT=viewplane, ZCLIP=zClip, projection = Projection,EYE=Eye)
Next I compute out the Convertion factors for X,Y and Z respectively.
The details for DEM are as follows
;Data dimensions are
xDemSize = 800
yDemSize = 800
;Pixel resolution is
GroundResoulution =[ 25,25] ;in meters
;Minimum height in the data set is
zMin = 0 ;in meters
;Maximum height is
zMax = 3500 ; in meters.
XCnv =[-0.5 , 1.0/xDemSize]
YCnv =[-0.5 , 1.0/yDemSize]
ZCnv =[zMin / (zMax-zMin) , 1.0 / (zMax-zMin) ]
since the dataset can be *heavy* on system (although in our test case
it is only 800x800) hence we reduce the data by congriding it and then
create a mesh of the dataset which is 10 units apart
DemData = congrid( origDEMData, xDemSize/10, yDemSize/10 )
nDemData=size(DemData)
xData = INDGEN(nDemData[1])*10
yData = INDGEN(nDemData[2])*10
;create the surface object
self.oSurface= OBJ_NEW('IDLgrSurface', DemData, $
STYLE = 2, Datax=xData, Datay=yData, $
XCOORD_CONV=XCnv , YCOORD_CONV=YCnv, $
ZCOORD_CONV=ZCnv)
;create the model
self.oSurfModel = obj_new('IDLgrModel',name ='SurfaceModel')
;add surface to model
self.oSurfModel->Add, self.oSurface
;add the model to our view
self.oSurfView ->add,self.oSurfModel
;Draw the surface on window
self.oWin->draw,self.oSurfView
Hope I have not commited any mistakes here! With this code, as I
mentioned, I am not getting any realistic depth perception. I belive
you are right when you say
----
This probably has more to do with how you are viewing the data. If you
want a scene to appear realistic, you need to scale everything
accordingly. You most likely have your surface at one scale, and your
viewing system at another.
-----
But I am not sure where I am setting the viewing systems scale and how
it is differing from the surface scale I would appreciate if you can
shed some light on this.
With regards
Chintan
|
|
|
|
|
Re: Need help in IDLgrSurface and vertical exaggeration [message #48041 is a reply to message #47895] |
Wed, 22 March 2006 08:14  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
David Streutker wrote:
> I'm not sure about the depth perception/perspective issue, but my
> (possibly incomplete) understanding of the vertical exaggeration is as
> follows:
>
> The scaling factor is set by the [XYZ]COORD_CONV keywords. Right now,
> your horizontal scaling is:
>
> 1.0/(800*25) = 0.00005 (in inverse meters)
>
> while your vertical scaling is:
>
> 1.0/3500 = 0.00029
>
> The ratio of these two is about 5.7, which should be your vertical
> exaggeration. In order to remove the exaggeration, the second element
> of the [XYZ]COORD_CONV keywords needs to be consistent for all
> dimensions.
Chintan,
Was this the issue? I've been so busy that I only glanced at your code
and I thought that your *COORD_CONV values might be at fault. I've said
this before, but I try hard to avoid using *COORD_CONV. I always screw
something up if I do...
-Rick
|
|
|