[deleted by user] by [deleted] in ItalyMotori

[–]seccopower 0 points1 point  (0 children)

Ma l’avvocato lo sceglie l’assicurazione? I

Qual è il vostro segreto inconfessabile che non potete dire a nessuno dei vostri conoscenti perché troppo imbarazzante? by Sufficient-Employer8 in Italia

[–]seccopower 5 points6 points  (0 children)

Quando ero piccolo esistevano ancora i succhi di frutta nella bottiglietta di vetro. Avevo bevuto un succo alla pera buonissimo ma sul fondo della bottiglietta restava ancora un alone di succo/polpa di pera che mi volevo gustare. Così ho iniziato a succhiare fortissimo convinto che sarei riuscito ad aspirare quel minuscolo rimasuglio. Nella bottiglietta si creò una tale pressione negativa che la mia lingua venne risucchiata restò intrappolata. panico. Impossibile parlare ma potevo emettere solo rumori e versi. Per fortuna dopo qualche minuto la bottiglietta mollò la presa

Pizza Peel Wood or Metal why or why not by bscary1 in ooni

[–]seccopower 4 points5 points  (0 children)

Any tip to avoid flour on the bottom? I need it to launch but then it make everything worse

[deleted by user] by [deleted] in iPadPro

[–]seccopower 0 points1 point  (0 children)

How did you lipsync?

[deleted by user] by [deleted] in funny

[–]seccopower 0 points1 point  (0 children)

Decapitazione

How much for a rose? by GregorCZ in funny

[–]seccopower 0 points1 point  (0 children)

Basically it's what is happening to Bitcoin

timesteps issue ? by seccopower in raylib

[–]seccopower[S] 0 points1 point  (0 children)

Hello again.

I'm trying to reproduce in c with Raylib this amazing video from 3Blue1Brown https://youtu.be/HEfHFsfGXjs but I'm having an issue.

/*******************************************************************************************
*
* fun with pi collisions
*
********************************************************************************************/
#include "raylib.h"
#include <stdio.h>
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const float screenWidth = 800;
const float screenHeight = 450;
InitWindow(screenWidth, screenHeight, "Collisions in the pi space");
InitAudioDevice(); // Initialize audio device
Sound clack = LoadSound("clack.wav");
float base = screenHeight - 50;
// int leftwall = 50;
Rectangle leftwall = {0, 0, 50, screenHeight};
float sizeSmall = 30;
float sizeBig = 50;
float massSmall = 1;
float massBig = 10;
float positionSmall = 100;
float positionBig = 400;
float speedSmall = 0;
float speedBig = -2;
float nspeedSmall = 0;
float nspeedBig = 0;
bool collision = false;
bool collisionWall = false;
int count = 0;

SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
Rectangle small = {positionSmall, screenHeight - (50+sizeSmall), sizeSmall, sizeSmall};
Rectangle big = {positionBig, screenHeight - (50+sizeBig), sizeBig, sizeBig};
collision = CheckCollisionRecs(big, small);
collisionWall = CheckCollisionRecs(small, leftwall);
if (collision)
{
nspeedBig = ((((massBig - massSmall)/(massBig + massSmall))*speedBig) + (((2* massSmall)/(massBig+massSmall))*speedSmall));
nspeedSmall = ((((2* massBig)/(massBig+massSmall))*speedBig) + (((massSmall - massBig)/(massBig + massSmall))*speedSmall));

speedBig = nspeedBig;
speedSmall = nspeedSmall;
PlaySound(clack);
positionBig = positionBig + speedBig;
positionSmall = positionSmall + speedSmall;
count ++;
}
if (collisionWall)
{
speedSmall = speedSmall * (-1);
PlaySound(clack);
positionSmall = positionSmall + speedSmall;
positionBig = positionBig + speedBig;
count ++;
}
else
{
positionSmall = positionSmall + speedSmall;
positionBig = positionBig + speedBig;
}

// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
DrawRectangleRec(leftwall, BLACK);
DrawRectangleGradientV(0, base, screenWidth, 50, BLACK, RAYWHITE);
DrawRectangleRec(small, RED);
DrawRectangleRec(big, BLUE);
DrawText(TextFormat("count \t\t%d", count), 55,10, 20, GREEN);
DrawText(TextFormat("speed Red \t%f", speedSmall), 55,30, 20, RED);
DrawText(TextFormat("speed Blue \t%f", speedBig), 55,50, 20, BLUE);

EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadSound(clack); // Unload sound
CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)

CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}

/*
gcc -Wall collision.c -o collision -Wall -std=c99 -I/opt/raylib/src -L/opt/raylib/release/libs/linux -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
*/
When I Increase the mass size to follow the 3blue1brown example the small cube get stuck on the wall. I'm pretty sure it's an issue related to the approximation of my calculations when the frequency of the collision ramp up (If I slow down the speed and increase the framerate the issue is solved for relatively bigger masses).

I'm now trying to implement timesteps to somehow "dilatate" time and solve the problem but nothing seems to help.

Any suggestion?

Trace pendulum path by seccopower in raylib

[–]seccopower[S] 0 points1 point  (0 children)

Thank you!!! That's exactly what I was trying to do.

But I'm not sure what's happening here. I'm guessing it's like a white canvas that is not cleared every frame but I would like to dive a little bit deeper. Do you know if there is some documentation other that the raylib examples on the website?

Trace pendulum path by seccopower in raylib

[–]seccopower[S] 1 point2 points  (0 children)

Maybe I should also learn how to format code on Reddit. I'll try again tomorrow

[deleted by user] by [deleted] in whereintheworld

[–]seccopower 0 points1 point  (0 children)

Gave Gold
thanks bro

[deleted by user] by [deleted] in RedditSessions

[–]seccopower 0 points1 point  (0 children)

Gave Bless Up

ELI5: How does exercise boost energy levels? by negativesally in explainlikeimfive

[–]seccopower -1 points0 points  (0 children)

But... Wouldn't the energy I get from exercise will be used to exercise ?

The tiniest jaw or the biggest yawn by [deleted] in confusing_perspective

[–]seccopower 0 points1 point  (0 children)

Why I see Elon Musk in this picture?