gpt4 book ai didi

Java3D 形状只能从一个角度看到

转载 作者:行者123 更新时间:2023-11-29 03:22:21 25 4
gpt4 key购买 nike

我正在尝试创建自己的 Java3D 形状,在本例中我只想要一个 3D 三角形。我已经使用 3 点的 TriangleArray 并将其转换为 Shape3D 对象并显示它,但是它只能从一个角度可见。当我旋转 View ,使另一侧面向相机时,它是不可见的。

我知道这可能是一件相对简单的事情,但不幸的是我正在努力弄清楚它,因为我希望我的形状可以从各个角度看到。

提前致谢。

最佳答案

想通了!

     // 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);

资源:http://www.duling.us/kevin/Java3D/simple/TriSpin.html

关于Java3D 形状只能从一个角度看到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22871164/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com