Intersect for Pixel Billboard?

I use the intersect node a lot for my GUI to basically get a hover or click on a certain object. Now there is a part of the GUI that I need to show using PixelBillboard, since it should always stay in the same location and stay the same pixel size regardless of renderer size. The problem now is that Intersect needs a Quad Transform, but using PixelBillBoard the quads I am placing are now using translates in pixel sizes. Also the “double scale” and “top left” options of PixelBillBoard need to be converted correctly.

So what I need is a way to convert a pixelbased transform of PixelBillBoard back to a world coordinate system which intersect understands.

I think PixelBillBoard should just have an “inverse transform” output, which can be combined with the pixel based transform of the quad to result in a correct world coordinate transform of the quad.

Any ideas?

pixelbillboard_quad.v4p (13.6 KB)

maybe do the intersection on your own with the HitTest node instead of Intersect? in 2d this is very easy.

Okay, I have never used HitTest, because the GUI I adapted uses Intersect for everything (I think it was CatGUI). Which node do I use for it, I can only see:

do you have the addonpack correctly installed? which vvvv version? 32 or 64 bit? how does your root patch look like?

HitTest (2d Quad):

i wonder what those Touched nodes are… maybe its the same nodes. no idea…

I have the addonpack installed correctly (well I dropped it in the main folder of vvvv). Its weird for some reason the node browser doesn’t show all the nodes for me when I just start typing. Usually I find them if I go into the category by right-clicking.

This is on 35.8 64bit, which I freshly downloaded today. But was happening also on 35.2 64bit that I was using before. Very strange. Any idea what could be causing that.

the “Touched” nodes are from Messages pack.

Do you know which category the HitTest nodes are in?

Edit: Found them in 2D category. So they are in the category, but just typing it they are not found !?!?!

I think I finally got it. Had to wrap my head around the coordinate system first. I assumed that the pixel coordinate system of PixelBillBoard starts bottom left, just like the mouse, but alas it does not. It starts in the center and goes from -width to +width and -height to +height. Since that is a bit weird I think is the reason PixelBillBoard has a switch for Double Scale. Weirdly it has a pin for Top Left, even though Bottom Left would make much more sense, since it would then be the same pixel space as the mouse!? Bottom Left makes more sense anyways since then all translate values are positive.

pixelbillboard_quad_v2.v4p (20.8 KB)

I think I will make a nicer little patch for the GUI Modal Window I am just working on (which should be the same size regardless of renderer, hence the PixelBillBoard). It will have a small node that can take a trigger, plus some extra data and hold it till you press yes. The layer is blended in and blurs the background. I think it might become my first small contribution :)

Teaser:

Just some different approaches.
pixelbillboard_quad_v3.v4p

1 Like

Thanks for showing the different approaches! I went with the Intersect method in the end as its about twice as fast as the other 2 that use HitTest.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.