asdasd
unknown
kotlin
4 years ago
587 B
10
Indexable
//wierchołki trójkąta w 3D
val wierzcholki = 40;
val promien = 0.2f
val array = FloatArray(wierzcholki*3);
var indexx = 0
array[indexx++] = 0.0f;
array[indexx++] = 0.0f;
array[indexx++] = 0.0f
var temp = wierzcholki-1
for(i in 0 until temp) {
var radius = (i / (temp - 1).toFloat()) * 2.0f * PI
array[indexx++] = (promien * cos(radius)).toFloat()
array[indexx++] = (promien * sin(radius)).toFloat() * wspolczynnik
array[indexx++] = 0.0f
}Editor is loading...