CameraPicking a Quad

Blitz3D Forums/Blitz3D Programming/CameraPicking a Quad

Gabriel(Posted 2004) [#1]
It's been brought to my attention that the menus in my game are irritating as they only register the mouse being over a piece of text if the mouse is over an alpha=1.0 area of the text, rather than the whole rectangular area.

I'm using a 3rd party GUI, but figured it would be pretty easy to modify it myself. Now I'm beginning to think it's not. It's camerapicking the quad ( poly picks ) so how would i change that so that it recognises the entire poly ( including blank space ) rather than just the area where there are letters?


DJWoodgate(Posted 2004) [#2]
Maybe ask the author of the GUI? He will be in a better position to help you than us trying to guess how it works without even seeing the code or knowing which GUI it is.


Gabriel(Posted 2004) [#3]
Well if it comes to that, I will. From looking at the code though, it just seems to be a basic camerapick on the mesh, so I figured it would be pretty easy to change if someone could give me the general idea of how to make a camerapick pick the entire mesh, not just that which is not alpha'ed zero.


big10p(Posted 2004) [#4]
That sounds very odd behaviour. Surely CameraPick just deals with triangles, regardless of how they're textured. :/


Gabriel(Posted 2004) [#5]
That's what I thought, Big10p. That's the way it works with image-based GUI items. But text items seem to be able to detect when the mouse is over the text but not when it's over the blank space. I imagine it's very handy for a lot of things, but not for this. I thought it might be something simple to do with entity or texture flags, but wasn't sure.

It only seems to be using a simple two-triangle quad for each character, so nothing funny going on there.


fredborg(Posted 2004) [#6]
It's probably just the space between the characters, camerapick doesn't consider the textures. You could set up a box with EntityAlpha 0, around the entire text and make it pickable.


Gabriel(Posted 2004) [#7]
Maybe. There seems to be an awful lot of space between the characters, if so. I'll have a look at modifying the sytem to put some kind of box around the text. Thanks for the suggestion.


Beaker(Posted 2004) [#8]
You can see the true gaps by removing the texture (temporarily for debugging). If you are using FONText (I presume you are) then you can add meshes where there are space characters. Maybe I should add meshes in the gaps as well, but it might just be just as easy to add one big quad around the whole thing.

Let me know if you need any more help. :)


Gabriel(Posted 2004) [#9]
Thanks, but I'm not using FonText. I'll see if I can add the additional "gap" meshes and see if that fixes it.


Rob(Posted 2004) [#10]
Then you should use Fontext.


Gabriel(Posted 2004) [#11]
I own FonText and I used to use it. It wasn't able to do all the things I wanted to do with a GUI, so I found one that did everything I wanted, and I'm using that instead. I'm still using FonText to generate the fonts though.

Having loaded the texture with no alpha, it seems that Fredborg was right that it's not the texture. I'm using a pretty bulky, squat texture, so it just seemed that the texture was affecting things. It'll mean some hefty digging through 3rd party code to make it pick up collisions on the gaps though, so I'll leave it till last. I have a lot of nice simple things to fix and add for the moment.

Thanks guys.


Warren(Posted 2004) [#12]
I use FONText to generate the fonts, but I do my own display routines.

Just thought I'd share...


Beaker(Posted 2004) [#13]
Just out of interest, what would you guys like to see in the FONText library? There are a few things I'd like to change as the code is pretty old now.


slenkar(Posted 2004) [#14]
is fontext 3d single surface sprites?


Beaker(Posted 2004) [#15]
Yes, the 3D library is single surface.


aCiD2(Posted 2004) [#16]
FONText is the bee's knees! :) However, i would like to see some changes, Beaks, start a thread and i'll put some ideas in. And no, its not for single surface sprites mainly, although there sia demo of an emitter :)