www.jpct.net
jPCT - a 3d engine for Java => Support => Topic started by: ErDetEnAnd? on January 03, 2009, 12:02:34 pm
-
Hello again.
Selection works on polygons, so if a selectable object carries a (partial) transparent texture, it would also be selected when clicked on the invisible part. Is there some kind of solution for this?
Regards.
-
In theory, it should be possible to do something like this:
- determine the picking point in camera space
- transform that point into object space
- transform that point into texture space
- perform a look up on the texture if that point is transparent or not
However, that is quite complex to do. What exactly do you need this for? Maybe there's a simpler solution that covers your case.
-
In my program billboards sometimes work as labels which should be selectable. The label surrounds some text, and fits hardly into a 2^x texture size. So the transparent part of the texture (outside the label) becomes selectable :-(
-
But why are you using the whole 2^x pixels of the texture for texturing the label if only a part of it is actually used? Maybe a screen shot helps to understand better what you are doing.
-
You sugguest jPCT to autoscale it?
-
You sugguest jPCT to autoscale it?
Autoscale what? What i meant was, that there should be no parts of the texture used for the label quad except for the label itself. It's difficult to explain...that's why i was asking for a picture to see if we are talking about the same thing...
-
Depending on what you are using this for, you might be able to make the polys smaller and change your UV coordinates so that only the non-transparent part of the texture is drawn.
-
Depending on what you are using this for, you might be able to make the polys smaller and change your UV coordinates so that only the non-transparent part of the texture is drawn.
That's what i tried to describe and wasn't really able to... ;D