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

Home » Public Forums » archive » IDLgrPolygon -TEXTURE_MAP question
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
IDLgrPolygon -TEXTURE_MAP question [message #43846] Thu, 28 April 2005 02:01 Go to next message
Ulan is currently offline  Ulan
Messages: 8
Registered: April 2005
Junior Member
OK, after applying golden rule - RFM (Read the F..ing Manual) and
looking at the forum, finally I have decided to post my question.
To start with- I am a beginner generally in programming and
particularly in IDL. I could not find solution to following
visualization problem.
I have set of spheres (oOrb). Those spheres are icons representing
regions extracted from images. Each sphere has x,y, time coordinates
and radius proportional to one of the attribute of the region (e.g.
size). There are also tubes connecting those spheres and showing
relationship between regions (continuation, split, merge etc.). I used
IDLgrModel and visualized it in XOBJVIEW. So far it works.
Now, I wanted to add time slider and images to XOBJVIEW that will show
up when user moves the slider. I have done it through IDLgrPolygon
object with texture map property being a grayscale image (see code
below, Input: 3D image (x,y, time)):


for i=0, ntimes-1 do begin
oImage=OBJ_NEW('IDLgrImage', image[*,*,i])

oPoly=obj_new("IDLgrPolygon", number_x, number_y, i ,$
STYLE=2,Texture_Map = oImage,$
Texture_Coord = [[0,0],[0,1], [1,1], [1,0]], HIDE=1)

oModel->Add, oPoly, POSITION=i
Endfor

And in the event_handler I change the property HIDE=1 into HIDE=0
for that slider position.(through POSITION keyword).

Now my question: The resulted image looks black, without any texture. I
have tried to add the COLOR keyword [255,255,255], but it didn't
help. Seems I am missing something simple here, but I am just
lost...That's why I have decided to ask the group. Any help would be
appreciated,

Thanks,
Ulan
Re: IDLgrPolygon [message #46330 is a reply to message #43846] Thu, 17 November 2005 00:07 Go to previous message
Jordi Garcia is currently offline  Jordi Garcia
Messages: 2
Registered: November 2005
Junior Member
Hi Rick,
you help me very much!!!
I put the DEPTH_OFFSET keyword in my two IDLgrPolygon, and works very good.

Yesterday i found another solution, i use the TEXTURE_MAP keyword, with
one IDLgrImage completly transparent, and works too, but i prefer, your
solution becaose i don't need create this object.

Thank you

Jordi


Rick Towler wrote:
> Simple example code would be helpful, but my guess is that you are
> seeing z-fighting or z-flimmering or z-stitching. This is caused by the
> fact that you are trying to draw two objects in the exact same z-space
> but due to limited z-buffer precision sometimes one is in front of the
> other and sometimes it is behind it.
>
> The easiest way to fix this is to offset your lines slightly in the
> positive Z direction or, depending on the objects, scaling the lines so
> they are slightly larger (using IDLgrModel::Scale).
>
> If these solutions don't work, RSI has graciously provided a few means
> of dealing with this. Check out the DEPTH_OFFSET keyword, which would
> work well for your 2 object scene. You can also use the DEPTH_TEST_*
> and DEPTH_WRITE_* keywords to manipulate how depth testing is handled.
> These are covered in the documentation.
>
> With a little experimentation you should be able to find a solution that
> works for you.
>
> -Rick
>
>
> Jordi Garcia wrote:
>
>> Hi!!
>>
>> I have a little problem.
>>
>> I use IDLgrPolygon to create a zone. I would like show only the lines,
>> and i would like that the polygon are with fill, but transparent.
>> Because i need to obtain some information about this object when i
>> click with the mouse inside this zone.
>>
>> I try to create 2 IDLgrPolygon, the first one with the lines, and the
>> second one with the transparent fill, but there are some polygons. that
>> erase some lines of the other polygons.
>>
>> I hope that somebody understant my english and my problem, and i hope
>> that somebody can help me!!!!
>>
>> Thanks!!!!!!
>>
>> Jordi Garcia.
>>
>>
>>
Re: IDLgrPolygon [message #46342 is a reply to message #43846] Wed, 16 November 2005 10:36 Go to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
Simple example code would be helpful, but my guess is that you are
seeing z-fighting or z-flimmering or z-stitching. This is caused by the
fact that you are trying to draw two objects in the exact same z-space
but due to limited z-buffer precision sometimes one is in front of the
other and sometimes it is behind it.

The easiest way to fix this is to offset your lines slightly in the
positive Z direction or, depending on the objects, scaling the lines so
they are slightly larger (using IDLgrModel::Scale).

If these solutions don't work, RSI has graciously provided a few means
of dealing with this. Check out the DEPTH_OFFSET keyword, which would
work well for your 2 object scene. You can also use the DEPTH_TEST_*
and DEPTH_WRITE_* keywords to manipulate how depth testing is handled.
These are covered in the documentation.

With a little experimentation you should be able to find a solution that
works for you.

-Rick


Jordi Garcia wrote:
> Hi!!
>
> I have a little problem.
>
> I use IDLgrPolygon to create a zone. I would like show only the lines,
> and i would like that the polygon are with fill, but transparent.
> Because i need to obtain some information about this object when i
> click with the mouse inside this zone.
>
> I try to create 2 IDLgrPolygon, the first one with the lines, and the
> second one with the transparent fill, but there are some polygons. that
> erase some lines of the other polygons.
>
> I hope that somebody understant my english and my problem, and i hope
> that somebody can help me!!!!
>
> Thanks!!!!!!
>
> Jordi Garcia.
>
>
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: pointers and IF statement
Next Topic: Re: limits of 'invert'

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

Current Time: Wed Oct 08 13:52:26 PDT 2025

Total time taken to generate the page: 0.00544 seconds