Any way to make a cube half transparent?

Gang Chen's icon

I want to make a jit.gl.gridshape cube half transparent so another cube which is inside it can be visible.

Any idea?

Can i achieve this with out a alpha picture? It seems that my Max can't load .png.

Thanks~

yaniki's icon

Hi Gang

Max can handle transparency, i.a. based on alpha channel from PNG. Remember to set "blend_enable" and "blend" attributes for your rendering pipeline. I have no access to my computer now, but, if you need, I can prepare for you a simple example patch later.

yaniki's icon

Ok, I have my computer now ;-)

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

Here's example patch: two cubes booth textured with images, both handling transparency via alpha channel or "color" attribute.

example.jpg
jpg
Gang Chen's icon

Hi Yaniki,

Millions thanks!! It helps alot!!

But is there any way that i can see the back side of the cube?

QQ-Photo20150504054831.jpg
jpg
yaniki's icon

> Millions thanks!! It helps a lot!!

I am glad that I was able to help.

> But is there any way that i can see the back side of the cube?

Yes. Try to set "cull_face" attribute of the [jit.gl.gridshape] object to 0 (off).

karl krach's icon

small question regarding the patch above (which helped me a lot, a million thanks for sharing!)
the patch works well with cubes and spheres but i do not get it to work if i make the gridshape object a plane (@shape plane).
why is that? and what would i need to change to texture a plane with a texture including transparency?

update: ten seconds after posting i found the problem: for some odd reason it has to do with @layer. if i put the transparent plane on a higher layer it does work as expected...
sorry for bothering.