asdasd

mail@pastecode.io avatar
unknown
kotlin
2 years ago
587 B
7
Indexable
Never
//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
        }