How could I pickPolygon behind some transparent faces?

Started by pitt, March 23, 2006, 04:27:32 AM

Previous topic - Next topic

pitt

Hi,

    I want to pick the terrain face. But, what if there are some transparent faces like smoke over that terrain face. How could I pickPolygon behind that transparent faces? If i disable the mouse selectable of those transparent faces, pickPolygon'll return null not the terrain face behind them. I try to use reproject2D3D with z by adding more z to avoid that transparent faces. But, I don't know how much z to set to avoid them cause my terrain is not flat. For example, i give z=0 then call pickPolygon and check that the returned face is the terrain face. If not, I add more z for reproject2D3D then call pickPolygon again until I get null or the terrain face. Sometimes, it miss the terrain face! I think it's not good that pickPolygon has to be called again and again as well. Any other way?
         
Thank you.

EgonOlsen

I see...that's obviously something that i haven't thought of yet. But it's never too late, so here is a new jar for you to try: http://www.jpct.net/download/beta/jpct_111pre3.jar

It adds two new variants of pickPolygon, each with an additional boolean parameter which, if set to true, should exclude transparent polygons from the calculation. But i haven't tested this, so please tell me if it works or not.

pitt

Thank you very much!!  :D
It works.

I suggest that not just transparent objects to be extruded.
To generalize the pickPolygon, those mouse unselectable objects should be extruded too.
Some cases like unuseable weapon or corpse drop on the ground need it.

I might need it in the future.  :wink:

EgonOlsen

Quote from: "pitt"
I suggest that not just transparent objects to be extruded.
To generalize the pickPolygon, those mouse unselectable objects should be extruded too.
Agreed. I think i'll change the boolean to an int where one can "or" some flags that indicate what should be excluded.