Re: Disappearing Object Graphics... [message #29486] |
Mon, 25 February 2002 10:41 |
Ted Cary
Messages: 53 Registered: October 2001
|
Member |
|
|
Rick Towler wrote:
> Ted,
>
> Whithout seeing any code, all I can guess is that maybe your view isn't set
> up properly. This would explain how when you translate your ROI's around
> they appear and dissapear as they move into and out of the viewing volume.
> But this is only a guess.
>
> can you provide a *simplified* example demonstating this behaviour?
>
> -Rick
The ROIs are definitely inside the viewing volume, at least as I understand
it--in front of the eye and between the clipping planes (parallel
projection). I think the problem has to do with how the renderer deals with
more than one ROI on the same plane, even if they don't overlap anywhere.
None of this explains why changing the color of one ROI erases another one.
I'll have two ROIs and then issue only two commands--1) a SetProperty to
change one ROI's color, 2) a Draw command to the graphics window to render the
view. The desired ROI appears in the new color, but the other ROI disappears
entirely (although it still shows up in the hierarchy, with no GetProperties
changed whatsoever). This is with the software renderer.
Putting every single ROI on a different plane between the clipping planes
seems to work, but it's silly and difficult. When I have 20 or more ROIs on
the screen in different ROIGroups and I'm erasing them and moving them around,
this solution is not easy to implement.
I'll write a simplified example when I find some time.
|
|
|
Re: Disappearing Object Graphics... [message #29489 is a reply to message #29486] |
Mon, 25 February 2002 09:33  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
Ted,
Whithout seeing any code, all I can guess is that maybe your view isn't set
up properly. This would explain how when you translate your ROI's around
they appear and dissapear as they move into and out of the viewing volume.
But this is only a guess.
can you provide a *simplified* example demonstating this behaviour?
-Rick
|
|
|
Re: Disappearing Object Graphics... [message #29501 is a reply to message #29489] |
Sun, 24 February 2002 19:27  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Mark Hadfield (m.hadfield@niwa.co.nz) writes:
>> Just for kicks, I've also tried every combination of RETAIN and
>> RENDERER
>
> You did this for kicks? You are a sick boy.
It *is* odd that everyone I know who has even gotten
involved with graphics object programming gets in
this programming-by-desperation mode sooner or later.
I've come to think of it as the necessary chaos just
before the big spiritual break-through. In fact, I've
grown so accustomed to it that I pretty much start out
like this when I'm learning something new in the object
graphics realm. Saves me a lot of time, usually.
Cheers,
David
P.S. Now that I think about it, this is like a zen koan.
Just cut through all the intellectual nonsense and head
right to the truth! "What is the value of the graphics
renderer?" What could be simpler than that?
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: Disappearing Object Graphics... [message #29502 is a reply to message #29501] |
Sun, 24 February 2002 15:14  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
"Ted Cary" <tedcary@yahoo.com> wrote in message
news:3C78492A.B7F0D8E1@yahoo.com...
> ...I've tried increasing the z-coordinate of vertices to bring ROIs
> to the front, and this occasionally works, although just as often
> decreasing the z-coordinate to a negative value works instead.
> Eventually I usually can find an xy-plane on which an individual ROI
> is visible, but it's beginning to look like the only way to draw all
> the ROIs is to put each one on a different plane with a different
> z-coordinate, which seems ridiculous since I'm only working on one
> plane. Why is any of this z-coordinate manipulation ever necessary
> when working in 2D?
Because Object Graphics is deeply and intrinsically 3D.
It does seem you have some sort of vertical-overlap issue. But I don't
understand why IDLgrROI objects should obscure one another (except
when they have exactly the same coordinates) because they are
represented by polylines or points, not polygons.
This may be a bug.
By the way, the vertical separation required for reliable overlap
control with object graphics is approx. 2^-16 times the distance
between front and rear clipping planes. But it does vary with the
renderer.
> Just for kicks, I've also tried every combination of RETAIN and
> RENDERER
You did this for kicks? You are a sick boy.
---
Mark Hadfield
m.hadfield@niwa.co.nz http://katipo.niwa.co.nz/~hadfield
National Institute for Water and Atmospheric Research
|
|
|
Re: Disappearing Object Graphics... [message #29504 is a reply to message #29502] |
Sun, 24 February 2002 09:30  |
Ted Cary
Messages: 53 Registered: October 2001
|
Member |
|
|
>
> I really don't know, Ted. But I *do* know that whenever
> I see something really, really weird I've learned to
> turn the software renderer on. Could this be the problem?
At least someone agrees it's weird. I thought I was going insane, or else
that I was missing something obvious. But the renderer is not the problem.
I've tried all combinations of RENDERER and RETAIN, and in fact the problem
first showed up with the software renderer on. I'm scared now to use
IDLgrWindow::GetProperty to retrieve the renderer number--probably it is
-Pi. Anyway, I think I read somewhere that MACs always use the software
renderer--not sure of this, though.
At least I solved the speed problem I was having, but I'm not sure the
solution is newsgroup-worthy. After running PROFILER (thanks Rick Towler),
I noticed dozens of calls to BYTARR that did not make sense. Sure enough,
there was a forgotten and useless line of code using IDLgrImage::GetProperty
to retrieve the image data with every Widget_Draw motion event, probably
left over from some image check I was doing during debugging. After
removing that line the object graphics program runs faster now than the old
direct graphics version. I was pretty pleased with myself until things
started disappearing.
|
|
|
Re: Disappearing Object Graphics... [message #29505 is a reply to message #29504] |
Sat, 23 February 2002 19:13  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Ted Cary (tedcary@yahoo.com) writes:
> I Googl-ed all the old postings about disappearing object graphics, and
> after spending the last few days trying out the suggestions I still
> haven't found a solution. I'm using object graphics in 2D.
I really don't know, Ted. But I *do* know that whenever
I see something really, really weird I've learned to
turn the software renderer on. Could this be the problem?
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|