Hello,
I have been struggling to find the right approach to this in TD. I am trying to find a way how to assign a new alpha value to a specific x, y coordinate of a Constant TOP.
I have found out that I can access the current rgba values by using top to chop and then chop to dat but I am struggling to find info on how to assign a new value. I accept that my current approach might be wrong so I welcome any other ideas too.
changeAlphaXY.toe (4.5 KB)
Thak you in advance,
Ruta
I would use reorder to integrate any B&W form as alpha layer. Then you can move and scale the form.
Another more creative way would be to use GLSL top (fragment or compute) to write your alpha as you like.
changeAlphaXY.toe (3.8 KB)
Another way you might think of doing it is multiplying an alpha-reduced rectangle over the image. You can make this rectangle any size. When you multiply it with your image, you’re essentially changing only the alpha of the original.
alpha.toe (3.5 KB)
I tried both solutions and I think I didn’t explain my intention well enough. I need to be able to change the alpha value of pixels semi-permanently (I thought that I would be able to do it in the dat table that has the rgba values from the Constant TOP but I guess it doesn’t work that way).
I have made a Kinect controlled image display, where I select an image from the grid on the left and display it on the right side of the screen. What I was hoping to do was to cover images with a solid colour and then gradually reveal the image underneath by mapping the Kinect hand coordinates to the Constant and turn the alpha value at that point to 0. If the only way to do it is by using GLSL then this idea might have to wait a bit until I get there. Thank you for the ideas
Gotcha. If I’m understanding you correctly, this might be what you’re after. In this .toe I’m creating an alpha mask by moving a circle around and putting it through a feedback loop to draw a trail of where that circle has been. If you crank up the opacity in the Level TOP to 1, then this will eventually make the entire area white, revealing the entire image instead of the white Constant TOP.
reveal.toe (3.8 KB)
I can’t believe I didnt think of a feedback loop, had never used the matte Top before so that’s a good learning point! Thank you so much for your help!