mikelizzi
Just dropped in
Offline
Posts: 8
|
 |
« Reply #3 on: 05. May 2011, 12:46:54 pm » |
|
Hi again. I'm still having problems. I reduced my code for a partially transparent 2D object to this. I insert it into my scene and insert another object of different color behind it. I can't see the other object at all. I can insert a partially transparent 3D object (created using TransparencyAttributes) that works fine. Any help identifying what I am doing wrong would be much appreciated.
public class Shape3DClockFace extends Shape3D { public Shape3DClockFace( float dummy ) { super( createGeometryTA() ); }
public static TriangleArray createGeometryTA() { GeometryConstruct gc = createGeometryConstructTA(); TriangleArray ta = GeomFactory.createTriangleArray( gc ); return ( ta ); }
public static GeometryConstruct createGeometryConstructTA() { Tuple3f[] allVertices = new Tuple3f[ 6 ]; Vector3f[] allNormals = new Vector3f[ 6 ]; Colorf[] allColors = new Colorf[ 6 ]; TexCoord2f[] allTex = null; Colorf defaultColor = new Colorf( 1f, 1f, 0f, .5f ); // Yellow 50% Transparent Vector3f normal = new Vector3f( 0f, 0f, 1f );
allVertices[ 0 ] = new Point3f( -.1f, .1f, 0f ); allVertices[ 1 ] = new Point3f( -.1f, -.1f, 0f ); allVertices[ 2 ] = new Point3f( .1f, .1f, 0f ); allVertices[ 3 ] = new Point3f( .1f, .1f, 0f ); allVertices[ 4 ] = new Point3f( -.1f, -.1f, 0f ); allVertices[ 5 ] = new Point3f( .1f, -.1f, 0f );
for ( int i = 0; i < 6; i++ ) { allNormals[ i ] = normal; allColors[ i ] = defaultColor; } return new GeometryConstruct( GeometryType.TRIANGLE_ARRAY, allVertices, allNormals, allTex, allColors ); } }
|