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

Home » Public Forums » archive » Re: How to draw IDLgrPlots over IDLgrImages?
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: How to draw IDLgrPlots over IDLgrImages? [message #67809] Thu, 27 August 2009 13:03 Go to next message
David Fanning is currently offline  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 Go to previous messageGo to next message
natha is currently offline  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 #67817 is a reply to message #67816] Thu, 27 August 2009 09:30 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
nata writes:

> I would really appreciate to learn about DEPTH_TEST or something like
> ZVALUE. I don't know if that can help me but I don't want to move the
> plots each time I draw another IDLgrImage over all.

Why don't you describe exactly what you are trying
to do, and we can maybe suggest a solution.

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 #67819 is a reply to message #67817] Thu, 27 August 2009 09:17 Go to previous messageGo to next message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
I would really appreciate to learn about DEPTH_TEST or something like
ZVALUE. I don't know if that can help me but I don't want to move the
plots each time I draw another IDLgrImage over all.

nata
Re: How to draw IDLgrPlots over IDLgrImages? [message #67820 is a reply to message #67819] Thu, 27 August 2009 09:06 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
nata writes:

> I know that the IDLgrModel is a container, so the objects are drawn in
> the order of the container. Right? If I don't want to use the Move
> method of the IDL_Container to place the IDLgrPlots at the end of the
> model, what can I do to plot the IDLgrPlots over the images?

I'm always confused when people reject the solution
a priori. :-)

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 #67908 is a reply to message #67816] Sun, 06 September 2009 20:54 Go to previous message
Robbie is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: use of loops in IDL for hashtable
Next Topic: Readu, Writeu Causing Segmentation Fault

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

Current Time: Wed Oct 08 17:09:50 PDT 2025

Total time taken to generate the page: 0.00751 seconds