
one.empty3.library.core.extra.TrianguleSphereAnimation Maven / Gradle / Ivy
Show all versions of empty3-library-3d Show documentation
/*
*
* * Copyright (c) 2024. Manuel Daniel Dahmen
* *
* *
* * Copyright 2024 Manuel Daniel Dahmen
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
*
*
*/
/*
Vous êtes libre de :
*/
package one.empty3.library.core.extra;
/*__
* @author MANUEL DAHMEN
*
* dev
*
* 28 déc. 2011
*/
/*
public class TrianguleSphereAnimation extends Animation {
private TRIObject o;
int n = 2;
public TrianguleSphereAnimation(Scene s) {
super(s);
}
public void modifier() {
o = new TRIObject();
double a = 0, b = 0, R = 10;
n++;
Point3D[][] pcurrent = null;
if (n > 1) {
pcurrent = new Point3D[n][n];
int i = 0;
for (b = 0; b < Math.PI; b += Math.PI / n) {
int j = 0;
for (a = -Math.PI; a < Math.PI; a += Math.PI / n) {
if (i < n && j < n)
pcurrent[i][j] = new Point3D(R * Math.cos(a)
* Math.cos(b), R * Math.cos(a) * Math.sin(b), R
* Math.sin(a));
j++;
}
i++;
}
}
for (int i1 = 0; i1 < n - 1; i1++)
for (int j = 0; j < n - 1; j++) {
o.add(new TRI(pcurrent[i1][j], pcurrent[i1][j + 1],
pcurrent[i1 + 1][j + 1], Color.black));
o.add(new TRI(pcurrent[i1 + 1][j], pcurrent[i1 + 1][j],
pcurrent[i1 + 1][j + 1], Color.black));
}
Scene s = new Scene();
s.add(o);
scene(s);
}
}
*/