comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Need help in IDLgrSurface and vertical exaggeration
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Need help in IDLgrSurface and vertical exaggeration [message #47895] Fri, 17 March 2006 09:31 Go to next message
David Streutker is currently offline  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 Go to previous messageGo to next message
raval.chintan is currently offline  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 #47898 is a reply to message #47896] Thu, 16 March 2006 16:28 Go to previous messageGo to next message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
raval.chintan wrote:

> I have been able to create the surface out of this dataset but I do not
> get the proper depth perception.
>
> I have even set the projection property to 2 but the mountains
> certainly do not seem to be much of mountains.

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.

We can get into all sorts of details but first, how are you viewing your
surface? XOBJVIEW or something you have written?

-Rick
Re: Need help in IDLgrSurface and vertical exaggeration [message #47909 is a reply to message #47898] Thu, 16 March 2006 07:04 Go to previous messageGo to next message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <1142502700.236024.214300@v46g2000cwv.googlegroups.com>,
raval.chintan@gmail.com wrote:

> Hello,
>
> I am facing some problems with surface object in IDL.
>
> I have DEM Data for ALPS mountain range which I want to visualize as a
> surface and do a flythrough.
>
> Data dimensions are 800x800
> Pixel resolution is of 25 meters
> Minimum height in the data set is 0 meters
> Maximum height is 3500 meters.
>
> I have been able to create the surface out of this dataset but I do not
> get the proper depth perception.
>
> I have even set the projection property to 2 but the mountains
> certainly do not seem to be much of mountains.

The vertical exaggeration is a function of the data space into which you put the
surface. Try this to see the effect of changing the vertical coordinate range:

IDL> z = 7.0*dist(800)
IDL> print, min(z), max(z)
0.00000 3959.80
IDL> isurface, z
IDL> isurface, z, zrange = [0.0, 10000.0]

You will need to do something similar with whatever you are using to display the
IDLgrsurface.

Ken Bowman
Re: Need help in IDLgrSurface and vertical exaggeration [message #48041 is a reply to message #47895] Wed, 22 March 2006 08:14 Go to previous message
Rick Towler is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: File sizes and the SAVE command
Next Topic: Re: 4D interpolation

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:48:18 PDT 2025

Total time taken to generate the page: 0.00653 seconds