Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
hello, I try to make a transparent cube, but when I change the alpha of the cube, the opacity does not change. I would like to know how to use createNewMaterialType () to make an object transparent. thank this.scene.getRootSceneNode().addChild(this.cube); |
||||
|
Hi, you don't need to write a shader for this, you can simply set the material type of your cube to EMT_TRANSPARENT_ALPHA_CHANNEL, instead of the default EMT_SOLID. That should be one line of code :) |
||||
|
I had already tried, but when I did, I don't know where to change the color and alpha of the cube. When i use EMT_TRANSPARENT_ALPHA_CHANNEL, i get a red cube whereas i don't set the color or the alpha. |
||||
|
It takes the alpha channel of the texture then as alpha channel. Just for testing, you could for example take any .png file with transparencies from the www just to try out. |
||||
|
its good, thanks :-} |
|