private void put(final Vector3 vec) { put(vec, false); }
public void setTextureMode(final TextureMode textureMode) { if (textureMode != _textureMode) { _textureMode = textureMode; updateGeometry(); } }
+ calculateBorderTriangles(_maxlevels); final double e = 0.5257 * _radius; pos++; put(new Vector3(0, _radius, 0)); pos++; put(new Vector3(a, y, 0)); pos++; put(new Vector3(b, y, -d)); pos++; put(new Vector3(-c, y, -e)); pos++; put(new Vector3(-c, y, e)); pos++; put(new Vector3(b, y, d)); pos++; put(new Vector3(c, -y, -e)); pos++; put(new Vector3(-b, -y, -d)); pos++; put(new Vector3(-a, -y, 0)); pos++; put(new Vector3(-b, -y, d)); pos++; put(new Vector3(c, -y, e)); pos++; put(new Vector3(0, -_radius, 0)); final Triangle[] ikosaedron = new Triangle[indices.length / 3]; for (int i = 0; i < ikosaedron.length; i++) {
+ calculateBorderTriangles(_maxlevels); final double e = 0.5257 * _radius; pos++; put(new Vector3(0, _radius, 0)); pos++; put(new Vector3(a, y, 0)); pos++; put(new Vector3(b, y, -d)); pos++; put(new Vector3(-c, y, -e)); pos++; put(new Vector3(-c, y, e)); pos++; put(new Vector3(b, y, d)); pos++; put(new Vector3(c, -y, -e)); pos++; put(new Vector3(-b, -y, -d)); pos++; put(new Vector3(-a, -y, 0)); pos++; put(new Vector3(-b, -y, d)); pos++; put(new Vector3(c, -y, e)); pos++; put(new Vector3(0, -_radius, 0)); final Triangle[] ikosaedron = new Triangle[indices.length / 3]; for (int i = 0; i < ikosaedron.length; i++) {
public void setTextureMode(final TextureMode textureMode) { if (textureMode != _textureMode) { _textureMode = textureMode; updateGeometry(); } }
private void put(final Vector3 vec) { put(vec, false); }
/** * @param name * name of the spatial * @param useIcosahedron * true to start with a 20 triangle mesh, false to start with a 8 triangle mesh * @param radius * the radius of this sphere * @param maxlevels * an integer >= 1 setting the recursion level * @param textureMode * the texture mode to use when generating texture coordinates */ public GeoSphere(final String name, final boolean useIcosahedron, final double radius, final int maxlevels, final TextureMode textureMode) { super(name); _maxlevels = maxlevels; _radius = radius; _maxlevels = maxlevels; _usingIcosahedron = useIcosahedron; _textureMode = textureMode; updateGeometry(); }
/** * @param name * name of the spatial * @param useIcosahedron * true to start with a 20 triangle mesh, false to start with a 8 triangle mesh * @param radius * the radius of this sphere * @param maxlevels * an integer >= 1 setting the recursion level * @param textureMode * the texture mode to use when generating texture coordinates */ public GeoSphere(final String name, final boolean useIcosahedron, final double radius, final int maxlevels, final TextureMode textureMode) { super(name); _maxlevels = maxlevels; _radius = radius; _maxlevels = maxlevels; _usingIcosahedron = useIcosahedron; _textureMode = textureMode; updateGeometry(); }