Transparency

Started by anonymous2, February 14, 2004, 11:16:12 PM

Previous topic - Next topic

anonymous2

Hi,

Is there anyway to change the material alpha settings so that you can see through a glas for example?

Does the 3ds file include this information?

tnx for answers :wink:

Anonymous

try this:

myobject3D.setTransparency(0);

works for me!

EgonOlsen

Yes, setTransparency(int) is the way to go. A 3DS-model may contain this information, but jPCT can't make use of it, because it requires transparency on a per object level, not per polygon. So you have to make sure that your windows (or whatever...) are objects of their own and then set the transparency "by hand" after loading.

Melssj5

Hello,I cant gey my objects trasparents, I set the trasnparency to values from 0 to 10,and I got the same, opac models, thats what I did:

levelParts=Loader.load3DS(this.getDocumentBase(), "bajos.3ds", 1f);//Cargo el mapa
       level=new Object3D(0);//inicializo el onjeto level
       for (int i=0; i<levelParts.length; i++) {

           Object3D part=levelParts[i];
       
           part.setCenter(SimpleVector.ORIGIN);
           part.rotateX((float)-Math.PI/2);
           part.rotateMesh();
           part.setRotationMatrix(new Matrix());
           if (part.getName ().compareTo("ventana03_jPCT62")==0)
               part.setTransparency (0);
           
           if (part.getName ().compareTo("ventana04_jPCT61")==0)
               part.setTransparency (0);
                   
           if ((i&1)==1)
               part.setTransparency(0);

           level=Object3D.mergeObjects(level, part);
       }


but the objects called ventana_04 and ventana 03 are not transparent.

Does the transparency only only works with Open Gl???????, because nothing happens when rendering by software, I couldnt try this with Open gl becausse I dont know how to use Open gl.  :oops: ,I made the levelon 3D Studio Max 6.0
Nada por ahora

EgonOlsen

No, the "problem" is, that the transparency only works on an per object level in jPCT, i.e. you can't make parts of an object transparent, while others are not. If you want to do this, you would have to split the objects into transparent and opaque ones (or just don't merge them but connect with an addChild() in your example).

Melssj5

Ok, thanks, I solved the that problem I compared the names of the Object3D part inside the for (), and if the name is what I was locking for, I set the transparency to 0 and add part to theWorld, if not I merged into the Object3D level., That was very usefull, thanks a lot.
Nada por ahora