Java3D形状仅从一个角度可见

Java3D形状仅从一个角度可见,java,3d,geometry,2d,Java,3d,Geometry,2d,我正在尝试创建自己的Java3D形状,在本例中,我只想要一个3D三角形。 我使用了一个三点的三角形光线,把它变成了一个Shape3D对象,并让它显示出来,但是它只能从一个角度看到。当我旋转视图,使另一侧朝向摄影机时,它不可见 我知道这可能是一个相对简单的问题,但不幸的是,我很难弄明白,因为我希望我的形状可以从各个角度看到 提前谢谢。想好了 // Because we're about to spin this triangle, be sure to draw // backf

我正在尝试创建自己的Java3D形状,在本例中,我只想要一个3D三角形。 我使用了一个三点的三角形光线,把它变成了一个Shape3D对象,并让它显示出来,但是它只能从一个角度看到。当我旋转视图,使另一侧朝向摄影机时,它不可见

我知道这可能是一个相对简单的问题,但不幸的是,我很难弄明白,因为我希望我的形状可以从各个角度看到

提前谢谢。

想好了

     // Because we're about to spin this triangle, be sure to draw
    // backfaces.  If we don't, the back side of the triangle is invisible.
    Appearance ap = new Appearance();
    PolygonAttributes pa = new PolygonAttributes();
    pa.setCullFace(PolygonAttributes.CULL_NONE);
    ap.setPolygonAttributes(pa);
    shape.setAppearance(ap);
资源:

找到了

     // Because we're about to spin this triangle, be sure to draw
    // backfaces.  If we don't, the back side of the triangle is invisible.
    Appearance ap = new Appearance();
    PolygonAttributes pa = new PolygonAttributes();
    pa.setCullFace(PolygonAttributes.CULL_NONE);
    ap.setPolygonAttributes(pa);
    shape.setAppearance(ap);
资源: