alpha and gl

Ste's icon

Hello, I want to make a simple animation in jitter, and I have two questions about alpha in GL.

1. In my patch I have a plane and ball under it. When I set alpha value of the plane to 0 it looks like the plane gets the background color and I can not see the ball throw the plane. Can anyone tell me how to fix that and why does this happen.

2. How can I make a shape alpha on the plane like in a picture for example.

please help me

4601.OneF.maxpat
Max Patch
cap10subtext's icon

Think the problem was with the way you had the trigger for the renderer set up. If you are triggering one gl shape explicitly while the other draws automatically you could run into layering issues.

Max Patch
Copy patch and select New From Clipboard in Max.

This should help. To get a texture on a mesh you need to send it a texture array (example I pulled off the forum).

Ste's icon

thanks a lot!!!! :)

Ste's icon

:( ok, I looked at the gl.mesh refpages.. second inlet is for vertex, but I couldn't understand how this part works.
Can you explain please.

4603.ScreenShot20121030at12.04.27PM.png
png
cap10subtext's icon

Okay this part is where i kind of fall on my face. I don't know how the vertex coordinate system works precisely but you can see what's happening in the following patch.

Each cell has 2 planes and it's dim is 20 20 so I'm assuming that the vertex coordinates are as follows:
Plane 0, cell 0 19 val 0
Plane 1 cell 0 19 val 0
Plane 0 cell 0 0 val 0
Plane 1 cell 0 0 val 1
Plane 0, cell 19 0 val 1
Plane 1 cell 19 0 val 0
Plane 0 cell 19 19 val 1
Plane 1 cell 19 19 val 1

Meaning from the bottom left clockwise you'll see (0,0;0,1;1,0;1,1) which are normalized corrdinates (but different than the standard jitter matrix which is usually represented as top-left, top-right, bottom-left, bottom-right.

So jit.matrix sets up a matrix with 2 planes, each cell represents an X, Y coordinate of dimensions 20 x 20. Jit.expr normalizes values across X on plane 0 (which represents the X in each cell) using (norm[0]) and then normalizes and subtracts the value from 1. down the Y plane on plane 1 (which represents the Y in each cell) using (1. -norm[1]).

Max Patch
Copy patch and select New From Clipboard in Max.

But this is my educated guess based on what I'm seeing... I could be mistaken.

Ste's icon

Thanks, you save me!