Re: How to draw IDLgrPlots over IDLgrImages? [message #67809] |
Thu, 27 August 2009 13:03  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
nata writes:
> I'm trying to plot some IDLgrPlots above an IDLgrImage. I draw the
> plots firstly and then the image. The image can change.
> If I don't do anything, the image is drawn over the plots and I don't
> want that.
>
> I'm trying to use the ZVALUE property of the IDLgrPlot but I didn't
> succeed. My idea is plot the IDLgrPlots using a different Z value,
> more closer to the EYE of the viewer. If I can do that, my problem
> will disappear.
>
> The View uses an ortogonal projection by default, the Znear and Zfar
> are set to [-1,1] and the eye is in the position 4.
> So, in theory, using the following declaration, all should work
>
> plot=OBJ_NEW('IDLgrPlot', COLOR=..., DATAX=INDGEN(10),DATAY=INTARR
> (10),ZVALUE=0.5, /USE_ZVALUE)
>
> But, the plot is always under the image. Can you help now ?
When you say "above", do you mean "in front of". And
when you say "below", do you mean "behind"? Otherwise,
I'm not sure I understand this conversation. I presume
these positions are in relationship to the eye as you
look at the viewplane rectangle.
If you want the image to be "behind" the plots, it should be
drawn first. This means it needs to be the first object drawn
in whatever model you are putting it into. You can put it in
that position when you add it:
mymodel -> Add, myimage, POSITION=0
This is how the image and plot, for example, are drawn in
XImage, and it works great.
http://www.dfanning.com/programs/ximage.pro
Cheers,
David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: How to draw IDLgrPlots over IDLgrImages? [message #67816 is a reply to message #67809] |
Thu, 27 August 2009 09:55   |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
I'm trying to plot some IDLgrPlots above an IDLgrImage. I draw the
plots firstly and then the image. The image can change.
If I don't do anything, the image is drawn over the plots and I don't
want that.
I'm trying to use the ZVALUE property of the IDLgrPlot but I didn't
succeed. My idea is plot the IDLgrPlots using a different Z value,
more closer to the EYE of the viewer. If I can do that, my problem
will disappear.
The View uses an ortogonal projection by default, the Znear and Zfar
are set to [-1,1] and the eye is in the position 4.
So, in theory, using the following declaration, all should work
plot=OBJ_NEW('IDLgrPlot', COLOR=..., DATAX=INDGEN(10),DATAY=INTARR
(10),ZVALUE=0.5, /USE_ZVALUE)
But, the plot is always under the image. Can you help now ?
Thanks,
nata
|
|
|
|
|
|
Re: How to draw IDLgrPlots over IDLgrImages? [message #67908 is a reply to message #67816] |
Sun, 06 September 2009 20:54  |
Robbie
Messages: 165 Registered: February 2006
|
Senior Member |
|
|
The IDL manual says something like:
Disabling the depth test function allows all primitives to be drawn on
the screen without testing their depth.
When the depth test is disabled, the last item drawn at a location is
the item that is on top.
I think that if you are using depth testing then you must be aware
that objects might disappear if they fall out of the clipping range.
For example the default value of the ZCLIP property of IDLgrView is
[-1,1]. You may also find the clipping to be graphics card dependant.
It's far simpler to avoid depth testing if at all possible when
drawing a 2D scene.
That being said, I still have a tendency to 'hack' scenes using depth
testing.
Robbie
|
|
|