Author Topic: Transparency  (Read 5308 times)

anonymous2

  • Guest
Transparency
« on: February 14, 2004, 11:16:12 pm »
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

  • Guest
Transparency
« Reply #1 on: February 15, 2004, 12:28:45 am »
try this:

myobject3D.setTransparency(0);

works for me!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Transparency
« Reply #2 on: February 15, 2004, 04:55:56 pm »
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.

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Transparency
« Reply #3 on: December 26, 2004, 03:38:29 am »
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:

Code: [Select]
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Transparency
« Reply #4 on: December 26, 2004, 12:34:52 pm »
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).

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Nice
« Reply #5 on: December 26, 2004, 01:58:58 pm »
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