Zadanie 2 update zadanie

This commit is contained in:
Władysław Kuczerenko 2024-06-14 17:03:08 +02:00
parent 75e04da1bf
commit debc0097d6
1 changed files with 3 additions and 3 deletions

View File

@ -55,7 +55,7 @@ GLuint VAO, VBO;
void initializeBalls() { void initializeBalls() {
srand(static_cast<unsigned>(time(0))); srand(static_cast<unsigned>(time(0)));
for (int i = 0; i < 10; ++i) { for (int i = 0; i < ballsAmount; ++i) {
float localAngle = angle + static_cast<float>(rand() % 60); // <angle, angle + 60> float localAngle = angle + static_cast<float>(rand() % 60); // <angle, angle + 60>
float localSpeed = speed + static_cast<float>(rand() % 5); float localSpeed = speed + static_cast<float>(rand() % 5);
@ -186,7 +186,7 @@ void rungeKuttaStep(Ball &ball, float dt) {
ball.y += ball.vy * dt; ball.y += ball.vy * dt;
} }
void setupSphereBuffers() { void setupSphereBuffer() {
float radius = 0.5f; float radius = 0.5f;
int slices = 20; int slices = 20;
int stacks = 20; int stacks = 20;
@ -277,7 +277,7 @@ void update() {
void setupOpenGL() { void setupOpenGL() {
compileShaders(); compileShaders();
setupSphereBuffers(); setupSphereBuffer();
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
glClearColor(0.1f, 0.1f, 0.1f, 1.0f); glClearColor(0.1f, 0.1f, 0.1f, 1.0f);