Welcher teil des Codes is für die Gravitation verantwortlich

Für allgemeine Fragen zur Programmierung mit PureBasic.
True29
Beiträge: 283
Registriert: 18.08.2012 19:18
Computerausstattung: Windows 8 64bit .Profan x2,Purebasic 5.5
Wohnort: Worms
Kontaktdaten:

Welcher teil des Codes is für die Gravitation verantwortlich

Beitrag von True29 »

hi , ich würde gerne so eine Gravitation in meinem Partikel system einbinden. Nun verstehe ich nicht ganz welcher Teil des Codes dafür zustandig ist.

Wäre nett wenn mir da wer helfen würde.
Grüße

video:
http://www.youtube.com/watch?v=TXY6NJm5se0


c++ code: von http://pastebin.com/SU5KG8TE

Code: Alles auswählen

	

    /*##############################################
    ##                                            ##
    ##  Program: Gravity simulation               ##
    ##  Author: Curcudel Eugen (GuessGen)         ##
    ##  E-mail: CurcudelEugen@gmail.com           ##
    ##  WebSite: http://GuessGen.wordpress.com    ##
    ##                                            ##
    ##############################################*/
     
    #include <GL/glut.h>
    #include <vector>
    #include <cmath>
     
    struct Particle {
            float x;
            float y;
            float r;
            float vx;
            float vy;
            float m;
            float color[3];
    };
     
    struct Line {
            float x1;
            float y1;
            float x2;
            float y2;
    } line;
     
    void timer(int = 0);
    void display();
    void mouse(int, int, int, int);
    void mouseMotion(int, int);
    void addParticle(float, float, bool = true, float = 0, float = 0);
    void removeParticles();
    void keyboard(unsigned char, int, int);
     
    int Mx, My, WIN;
    bool PRESSED_LEFT = false, PRESSED_RIGHT = false,
         PRESSED_MIDDLE = false, SPEED_PARTICLES = false;
     
    std::vector<Particle> particles;
     
    int main(int argc, char **argv)
    {
            Particle p;
            //initial centered Huge mass particle
            p.x = 0;
            p.y = 0;
            p.vx = p.vy = 0;
            p.m = 10000;
            p.r = 10;
            p.color[0] = 1;
            p.color[1] = 1;
            p.color[2] = 0;
            particles.push_back(p);
     
            glutInit(&argc, argv);
            glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
            glutInitWindowSize(500, 500);
            glutInitWindowPosition(50, 50);
            WIN = glutCreateWindow("Gravity");
     
            glClearColor(0, 0, 0, 1);
            glMatrixMode(GL_PROJECTION);
            glLoadIdentity();
            glOrtho(-250.0, 250.0, 250.0, -250.0, 0, 1);
           
            glutDisplayFunc(display);
            glutMouseFunc(mouse);
            glutMotionFunc(mouseMotion);
            glutKeyboardFunc(keyboard);
            timer();
           
            glutMainLoop();
            return 0;
    }
     
    void timer(int)
    {
            display();
            if(PRESSED_LEFT && !SPEED_PARTICLES)
            {
                    addParticle(10, 3); //add tiny particle
                    PRESSED_LEFT = false;
            }
     
            if(PRESSED_RIGHT)
            {
                    addParticle(10000, 10, 0); //add huge particle
                    PRESSED_RIGHT = false;
            }
     
            if(PRESSED_MIDDLE)
                    removeParticles(); //remove all particles
     
            for(int i = 0; i < particles.size(); i++)
            {
                    Particle &p = particles[i];
                    bool not_fall = true;
                    for(int j = 0; j < particles.size(); j++)
                    {
                            if(j == i || p.m >= 10000) // we consider the 10000 as infinit (big mass) so this particles won't move
                                    continue;
     
                            const Particle &p1 = particles[j];
     
                            float d = sqrt((p1.x - p.x)*(p1.x - p.x) + (p1.y - p.y)*(p1.y - p.y));
     
                            if(d > p1.r)
                            {
                                    p.vx += 0.03 * p1.m / (d*d) * (p1.x - p.x)/d; //f = ma => a = f/m
                                    p.vy += 0.03 * p1.m / (d*d) * (p1.y - p.y)/d;
                            }
                            else
                                    not_fall = false;
                    }
     
                    if(not_fall)   
                    {
                            p.x += p.vx;
                            p.y += p.vy;
                    }
                    else
                            particles.erase(particles.begin()+i);
            }
     
            glutTimerFunc(1, timer, 0);
    }
     
    void display()
    {
            glClear(GL_COLOR_BUFFER_BIT);
     
            //draw the drag line
            glColor3f(0, 0, 1);
            glBegin(GL_LINES);
                    glVertex2f(line.x1, line.y1);
                    glVertex2f(line.x2, line.y2);
            glEnd();
     
            //draw particles
            for(int i = 0; i < particles.size(); i++)
            {
                    Particle &p = particles[i];
                    glColor3f(p.color[0], p.color[1], p.color[2]);
                    glBegin(GL_POLYGON);
                    for(float a = 0; a < 2*M_PI; a+=0.2)
                            glVertex2f(p.r*cos(a) + p.x, p.r*sin(a) + p.y);
                    glEnd();       
            }
     
            glFlush();
            glutSwapBuffers();
    }
     
    void mouse(int button, int state, int x, int y)
    {
            //set the coordinates
            Mx = x - 250;
            My = y - 250;
     
            //add speed particles by line draging
            if(SPEED_PARTICLES)
            {
                    if(line.x2 != 0 && line.y2 != 0 && state == GLUT_UP && PRESSED_LEFT)
                            addParticle(100, 5, 1, line.x1 - line.x2, line.y1 - line.y2); //add a speed particle
                    else
                    {
                            line.x1 = line.x2 = Mx;
                            line.y1 = line.y2 = My;
                    }
            }
     
            //check which button is pressed
            if(button == GLUT_LEFT_BUTTON)
                    PRESSED_LEFT = state == GLUT_DOWN;
            else if(button == GLUT_RIGHT_BUTTON)
                    PRESSED_RIGHT = state == GLUT_DOWN;
            else if(button == GLUT_MIDDLE_BUTTON)
                    PRESSED_MIDDLE = state == GLUT_DOWN;
    }
     
    void mouseMotion(int x, int y)
    {
            Mx = x - 250;
            My = y - 250;  
     
            //end of line with draging
            if(SPEED_PARTICLES && PRESSED_LEFT)
            {
                    line.x2 = Mx;
                    line.y2 = My;
            }
    }
     
    void addParticle(float m, float r, bool randColor, float vx, float vy)
    {
            Particle p;
            p.x = Mx;
            p.y = My;
            p.vx = vx / 30; // /30 in case it is a speed particle,
            p.vy = vy / 30; // slow down the speed a little
            p.m = m;
            p.r = r;
            if(randColor)
            {
                    p.color[0] = rand()%200 / 200.0;
                    p.color[1] = rand()%200 / 200.0;
                    p.color[2] = rand()%200 / 200.0;
            }
            else // if is huge particle make it yellow
            {
                    p.color[0] = 1;
                    p.color[1] = 1;
                    p.color[2] = 0;
            }
            particles.push_back(p);
     
            if(line.x1 != 0)
                    line.x1 = line.x2 = line.y1 = line.y2 = 0;     
    }
     
    void removeParticles()
    {
            for(int i = 0; i < particles.size(); i++)
                    particles.pop_back();
    }
     
    void keyboard(unsigned char key, int x, int y)
    {
            switch(key)
            {
                    case 's':
                            SPEED_PARTICLES = !SPEED_PARTICLES;
                            break; 
                    case 27:
                            removeParticles();
                            glutDestroyWindow(WIN);
                            exit(0);
                            break;
            }
    }

i7,12gb ram , Windows 10 ,Purebasic 5.50
Benutzeravatar
NicTheQuick
Ein Admin
Beiträge: 8838
Registriert: 29.08.2004 20:20
Computerausstattung: Ryzen 7 5800X, 64 GB DDR4-3200
Ubuntu 24.04.2 LTS
GeForce RTX 3080 Ti
Wohnort: Saarbrücken

Re: Welcher teil des Codes is für die Gravitation verantwort

Beitrag von NicTheQuick »

Eigentlich nur diese Schleife.

Code: Alles auswählen

 for(int i = 0; i < particles.size(); i++)
            {
                    Particle &p = particles[i];
                    bool not_fall = true;
                    for(int j = 0; j < particles.size(); j++)
                    {
                            if(j == i || p.m >= 10000) // we consider the 10000 as infinit (big mass) so this particles won't move
                                    continue;
     
                            const Particle &p1 = particles[j];
     
                            float d = sqrt((p1.x - p.x)*(p1.x - p.x) + (p1.y - p.y)*(p1.y - p.y));
     
                            if(d > p1.r)
                            {
                                    p.vx += 0.03 * p1.m / (d*d) * (p1.x - p.x)/d; //f = ma => a = f/m
                                    p.vy += 0.03 * p1.m / (d*d) * (p1.y - p.y)/d;
                            }
                            else
                                    not_fall = false;
                    }
     
                    if(not_fall)   
                    {
                            p.x += p.vx;
                            p.y += p.vy;
                    }
                    else
                            particles.erase(particles.begin()+i);
            }
True29
Beiträge: 283
Registriert: 18.08.2012 19:18
Computerausstattung: Windows 8 64bit .Profan x2,Purebasic 5.5
Wohnort: Worms
Kontaktdaten:

Re: Welcher teil des Codes is für die Gravitation verantwort

Beitrag von True29 »

was macht er da genau ?
kann das wer erklären.
i7,12gb ram , Windows 10 ,Purebasic 5.50
Benutzeravatar
NicTheQuick
Ein Admin
Beiträge: 8838
Registriert: 29.08.2004 20:20
Computerausstattung: Ryzen 7 5800X, 64 GB DDR4-3200
Ubuntu 24.04.2 LTS
GeForce RTX 3080 Ti
Wohnort: Saarbrücken

Re: Welcher teil des Codes is für die Gravitation verantwort

Beitrag von NicTheQuick »

Eigentlich sieht man das doch gut.

Er berechnet von jedem Partikel den Abstand zu jedem anderen Partikel und berechnet dann aus Abstand und ihrer jeweiligen Masse die neuen Geschwindigkeiten in X- bzw. Y-Richtung. Dafür nutzt er das Gesetz ð v_partikel_1 = factor * particel_masse / abstand² * (v_partikel_2 - v_partikel_1) / abstand.

Ich hab die Formel jetzt nicht überprüft, aber so steht sie zumindest im Code. Der 'factor' muss wohl angepasst werden, je nach Framerate.
True29
Beiträge: 283
Registriert: 18.08.2012 19:18
Computerausstattung: Windows 8 64bit .Profan x2,Purebasic 5.5
Wohnort: Worms
Kontaktdaten:

Re: Welcher teil des Codes is für die Gravitation verantwort

Beitrag von True29 »

danke erst mal ich schau mal wie weit ich komme
i7,12gb ram , Windows 10 ,Purebasic 5.50
Benutzeravatar
STARGÅTE
Kommando SG1
Beiträge: 7039
Registriert: 01.11.2005 13:34
Wohnort: Glienicke
Kontaktdaten:

Re: Welcher teil des Codes is für die Gravitation verantwort

Beitrag von STARGÅTE »

Schreib dir zu allererst mal ein paar Prozeduren (und damit ein Include) für Vektoren.
Setzen, Addieren, Sub., Multip., Länge usw.

Die brauchst du, und es macht es einfacher solche Berechnungen zu schreiben.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Aktuelles Projekt: Lizard - Skriptsprache für symbolische Berechnungen und mehr
True29
Beiträge: 283
Registriert: 18.08.2012 19:18
Computerausstattung: Windows 8 64bit .Profan x2,Purebasic 5.5
Wohnort: Worms
Kontaktdaten:

Re: Welcher teil des Codes is für die Gravitation verantwort

Beitrag von True29 »

puh ok danke.
i7,12gb ram , Windows 10 ,Purebasic 5.50
True29
Beiträge: 283
Registriert: 18.08.2012 19:18
Computerausstattung: Windows 8 64bit .Profan x2,Purebasic 5.5
Wohnort: Worms
Kontaktdaten:

Re: Welcher teil des Codes is für die Gravitation verantwort

Beitrag von True29 »

will sich hier wer schnell 50€ verdienen und mir das schnell erweitern ? mir fehlen leider die kenntnisse :(
Würde also nur darum gehen den genannten code in die sprite engine einzubauen das wars.
bei interesse PM ;)

Grüße
i7,12gb ram , Windows 10 ,Purebasic 5.50
Benutzeravatar
STARGÅTE
Kommando SG1
Beiträge: 7039
Registriert: 01.11.2005 13:34
Wohnort: Glienicke
Kontaktdaten:

Re: Welcher teil des Codes is für die Gravitation verantwort

Beitrag von STARGÅTE »

Nach nicht mal einem Tag aufgegeben?

Einfaches Beispiel, linke Maus zum hinzufügen von Partikeln (Masseteilchen)

Code: Alles auswählen

InitSprite()
UsePNGImageDecoder()


Enumeration
	#Window
	#Sprite
EndEnumeration


Structure Vector
	X.f
	Y.f
EndStructure

Structure Particle
	Position.Vector
	Velocity.Vector
	Force.Vector
	Mass.f
EndStructure

Global NewList Particle.Particle()


; Partikel hinzufügen
Procedure AddParticle(X.f, Y.f)
	
	AddElement(Particle())
	Particle()\Position\X = X
	Particle()\Position\Y = Y
	Particle()\Mass = 200.0
	
EndProcedure


; Gavitation wirken lassen
Procedure ExamineParticle()
	
	Static OldTime.i
	Protected Factor.f
	Protected *Particle.Particle
	Protected Difference.Vector, Distance.f, Value.f
	
	If OldTime = 0
		Factor = 0
	Else
		Factor = (ElapsedMilliseconds()-OldTime)*0.001
	EndIf
	OldTime = ElapsedMilliseconds()
	
	; Geschwindigkeit + Kraft/Masse und Position + Geschwindigkeit
	ForEach Particle()
		Particle()\Velocity\X + Factor * Particle()\Force\X / Particle()\Mass
		Particle()\Velocity\Y + Factor * Particle()\Force\Y / Particle()\Mass
		Particle()\Position\X + Factor * Particle()\Velocity\X
		Particle()\Position\Y + Factor * Particle()\Velocity\Y
		; Außere Kraft, zB um Partikel in der Mitte zu halten
		Particle()\Force\X = 0 ;(400-Particle()\Position\X)*Particle()\Mass
		Particle()\Force\Y = 0 ;(300-Particle()\Position\Y)*Particle()\Mass
	Next
	
	; Neue Kräfte berechnen
	ForEach Particle()
		*Particle = Particle()
		While NextElement(Particle())
			Difference\X = Particle()\Position\X - *Particle\Position\X
			Difference\Y = Particle()\Position\Y - *Particle\Position\Y
			Distance = Sqr(Difference\X*Difference\X+Difference\Y*Difference\Y)
			If Distance < 10.0 ; Partikel verschmelzen
				*Particle\Velocity\X * *Particle\Mass
				*Particle\Velocity\Y * *Particle\Mass
				*Particle\Mass + Particle()\Mass
				*Particle\Velocity\X = (*Particle\Velocity\X + Particle()\Velocity\X*Particle()\Mass) / *Particle\Mass
				*Particle\Velocity\Y = (*Particle\Velocity\Y + Particle()\Velocity\Y*Particle()\Mass) / *Particle\Mass
				DeleteElement(Particle())
				Continue
			EndIf
			Value = 10000 * *Particle\Mass * Particle()\Mass / (Distance*Distance*Distance)
			Particle()\Force\X - Difference\X*Value
			Particle()\Force\Y - Difference\Y*Value
			*Particle\Force\X + Difference\X*Value
			*Particle\Force\Y + Difference\Y*Value
		Wend
		ChangeCurrentElement(Particle(), *Particle)
	Next
	
EndProcedure


OpenWindow(#Window, 0, 0, 800, 600, "ScreenTitle", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(#Window), 0, 0, WindowWidth(#Window), WindowHeight(#Window), 0, 0, 0)

CatchSprite(#Sprite, ?Particle, #PB_Sprite_AlphaBlending)


Repeat
	
	Repeat
		
		Select WindowEvent()
			Case #PB_Event_CloseWindow
				End
			Case #PB_Event_LeftClick
				AddParticle(WindowMouseX(#Window), WindowMouseY(#Window))
			Case #Null
				Break
		EndSelect
		
	ForEver
	
	ClearScreen(0)
	
	ExamineParticle()
	
	ForEach Particle()
		Radius = Sqr(Particle()\Mass)
		ZoomSprite(#Sprite, Radius*2, Radius*2)
		DisplayTransparentSprite(#Sprite, Particle()\Position\X-Radius, Particle()\Position\Y-Radius)
	Next
	
	FlipBuffers()
	
ForEver



DataSection
	Particle:
	Data.q $0A1A0A0D474E5089,$524448490D000000,$2000000020000000,$7A7A730000000608,$47527301000000F4
	Data.q $0000E91CCEAE0042,$FF0044474B620600,$93A7BDA0FF00FF00,$7359487009000000,$130B0000130B0000
	Data.q $000000189C9A0001,$03DC07454D497407,$07E5EB8E3B0F100C,$5441444992080000,$471C8F5D978DC358
	Data.q $667BBAAA739F8615,$48FEBDAF5EBD7667,$925C0481012100E2,$E20FF05C16C12F0B,$22906E24247BE01F
	Data.q $DC03F889EE6227F1,$488411091AD22704,$18EC760944C8A0A4,$7747CD7EF6D777AF,$2637ACCF45C39D57
	Data.q $3E9AAEA3D4A92896,$E339E15F79EF555F,$FEB00286DEF1BAF2,$1370405510401676,$C07510371D6E9140
	Data.q $B7807135C6E7A380,$3B5AFD5BF5BC637E,$1B800C972B8BECF2,$04AAF68C972B9537,$27331A98A2A202DC
	Data.q $37055C7300131440,$C9FB531ACC5701D4,$D597D7E92A8BE62B,$C0EF9F5371BEDFE7,$50686ACF5C6F0DF1
	Data.q $55371405001A182C,$50794700EE650C41,$AA57ACDC350CCC57,$1F3447DDFBACF77D,$138FFCA6F6EC4AFE
	Data.q $2AF69C972BF1ACF2,$F22CC3440408B701,$509AD2A86262A800,$C5350DDC8B1C4E74,$AAAC9CD9629AB92C
	Data.q $CDDEF4D7BFACB159,$E4BE5F8DC7A13AAF,$1010AA2C505A6FB4,$30A00ADC0A04408D,$55B8CB2FB16204B4
	Data.q $A19564D2AC9A9686,$F792C2E2D7265005,$A6237D98A1546B92,$CCBCA8FC97CB84AB,$C11A00B55D868E16
	Data.q $E60418346661A1A2,$331582BDAA1A2DD3,$0902D1260B01CFD9,$92FBFBA6884B1468,$28989B8CD0C2B54B
	Data.q $8DF3C65CAABA798A,$BBAFD7DA7E642659,$CF33E68B14100502,$889CCA85516E0345,$71B59135385B8168
	Data.q $C2F8D8BD4828E1C9,$0454816D45A1F824,$88CB71681A966D4F,$D116B709A192C566,$D1B7BE80189AE376
	Data.q $62BE0058A0B71DD5,$443D39BED112B15C,$0C1692F9240DB807,$257C2FD060559417,$C0DAC2CE60607D29
	Data.q $E974AA56E3E9CD97,$C400D114D69542B7,$A6FB412A3967AE37,$15BF47ED2CC21505,$AB70AD10F4C33B2B
	Data.q $3CB0568BCB45ED10,$8A565468D61F28AC,$EE4C1630EC1C87A9,$617686FAC51D69EE,$49911A964B7F79BA
	Data.q $2915875B9B8C665E,$06616BEAE9775FAE,$87B442A0479AF32E,$4582C88A2F925F5B,$E042C4E7325D0A4A
	Data.q $6A142A6B096D6284,$2A1918557612D0BE,$FD2265712CFDE666,$0541086A0427B17D,$A039C4BBAFD75433
	Data.q $88E3473058255258,$9A542A9684C486CA,$A9E59063A72D1419,$9516B2A965EAB7B8,$090AE590625DCA95
	Data.q $C91869B8E016C0E3,$91BB2EA7B90185E0,$F9808CBE8A9530ED,$64D50BD9C7203695,$1CCBCF559396DAA1
	Data.q $527ABC2D09C07024,$C27979527B416379,$C5A874DA5940D4FC,$A0652FDD390AF6CF,$B5755A59AA4B40C2
	Data.q $8F2B69A42B8BECE5,$FA4E0F928EB77C6B,$1A9B32FABB3E2201,$1F43D402D5441371,$6510797C427A20C7
	Data.q $7891C32B4EF783D5,$4285E3C03E7B22FC,$3C5CA14DFBDCAA5E,$C56ACB148ECD2BEF,$FCC307EC1524A6D6
	Data.q $EF6C26F64F2162F2,$80D216A1E303F518,$295A2D3263681614,$79DA2229E0790C6C,$2627A4E378FA5113
	Data.q $27339295E3FAB1E3,$12DF73F3D0BD2C82,$E2F539B9691F3E16,$E9D3C4D6DACAAFA7,$DDDEAF94FE793925
	Data.q $9C07D7932D33BD96,$BEDF3DBDE1E44F19,$AC52A38C2351E63D,$69A5B40D8D869606,$7BE4A3C646E334A6
	Data.q $A208E6A62A34C079,$F847A9C4F21A8458,$9185941EDD91A0E4,$F172AFEFD5E40E2E,$F3F0B13FB53919EC
	Data.q $455978AF6FF9E9EF,$86557177BD0D7F91,$8769B1FF7737F97F,$C1CBC8BEBC245717,$83DB57B3B3534CE5
	Data.q $01D3FBE083ADD15D,$22B4B48AA98576A3,$B8052BAC4C5450D1,$D0B782B45CEE9449,$B1A3B6D4D6F5235A
	Data.q $DCE41747E7438DF4,$7B83E90DCF295677,$430BE3E7B4FF4419,$A43CEF97925F1716,$E01FF026B7EA70F9
	Data.q $C05B4443B44FB031,$FCC314070E83C3B5,$0F624C293719EDF9,$879785CB862AF619,$FDDBC144774F660D
	Data.q $CC79DD1903BDED29,$F4982442CA0E124E,$E1DE4E423265ECDB,$08032ECFE61DC76C,$DA7B0B11DE0618AE
	Data.q $14DC7C1638B81356,$A9C9E95FF480707A,$0F855501FBA90F5B,$B56593EC7F78CBEF,$B1F71349092227CA
	Data.q $A080D011D0A7DF05,$3C66467C62475B98,$D9A1A9DA57CC18CE,$055A2952FB985C9C,$C993D3E4A34D1157
	Data.q $CD9D9F7C7C1E83FB,$E89C1DA1ECFC5903,$383C96FBFD323523,$A249D3EA6766F03D,$9AD47232C1C9D909
	Data.q $A1DE6E6C36BBC11D,$8519228475469CDD,$D79B3125A541E84B,$6A195F2F247BE67B,$B30E5E27B7B67038
	Data.q $923F9FDB69BA7C2E,$DCEA8971791285BD,$C97CE4F88F47DB82,$45BB742DC5F042F4,$9079A5379816851A
	Data.q $0F66D2E478F1608E,$E83689B14ED06AAE,$E15CE17CD1768628,$B864F6DDBF5A8F0B,$9B6FEA7E4BE54BBA
	Data.q $DE562797924EAF7A,$A42C267C7F8F627B,$D90767731D3E2B45,$F9EEA17DAD71993F,$CACD8239B84D45A1
	Data.q $CC10C0CCDC095DEB,$57244C1D7936E4A3,$EFD6BE07FBC73632,$DA56BDE5F2083E79,$F83EF4D66CAF91C5
	Data.q $89BB0888956A3FD2,$E6FE591EB74D5034,$07F1F7FA58D18312,$809126A0B50FD17B,$580C80D2D0CDA884
	Data.q $A3510CDC3371D444,$0B51649C687772C0,$7A7DB269B2A2B71B,$9F1BFAD6787EA7E0,$31492225AFAAADC8
	Data.q $A7634DBD620B5052,$8F68C89533A5F7DA,$2644A74363CFBF6A,$3AEE763E68867A73,$33142A0E76FEB952
	Data.q $F6A18D1116E0554A,$0F58A09E93063441,$70A1EACC5F642AD1,$CC2E402B6EBB6859,$ABC173E4E9499CC5
	Data.q $841DAB7DA83E9994,$2C23A3242AD5B827,$A3A926B8DDA26774,$5EB19CBCCCD4B364,$F588DB4AEB4F83C4
	Data.q $5E28DA0E72DC750C,$5B91B8E65423ECE6,$F787E149D1245CF1,$3689E832142E1EC6,$C232DCD9AAAD59B5
	Data.q $EB2BD00959E5199C,$E8C9A20B74404CC6,$EB9269CD6D45AC58,$96C6C5630AB1B704,$8762A6E87D816474
	Data.q $6DC6155DF15A8E88,$B1357BB708EE4F29,$B70DE8B3C4798568,$5ED3B968C72D173C,$8D0621666FD3CE25
	Data.q $7B3F29416F5A4FE7,$2B4CC5A202CCC9A4,$6459E4018A3A29CC,$EA28F712ED433E69,$BAC23BC26887BED3
	Data.q $B4A7C78D9CD24D71,$193C4DF6A782B85C,$D10B036B0959DAFE,$83EDEA6F612195F1,$CC9AE8CED623AD03
	Data.q $498F962A8211DA64,$8F8DA4F9CD2B9CB3,$02971D21DE2E438C,$7F9429B8DD865C7A,$083348A5A5B29CD0
	Data.q $6D7C388EEF50A8D2,$B431B6CCE7D429CD,$AC51B446A156A731,$C5729779AD399201,$B68EF8F5511E8512
	Data.q $C9854FEBCB843637,$C5E2B23EEFD9A573,$B89FF722EEEE0C81,$05EDA5CFE7F89D4F,$8E98E65502E74353
	Data.q $87E6681C77AE331B,$FDE8ACFC935C6F2D,$7C7F199F8BF7EEDA,$4EA74C2FD7F0DBB7,$E3E0B73FC88793FF
	Data.q $BFFC7039D2A2DD2F,$3F61B9D4433C7533,$FEF1F3A713FFFC66,$CB766450DE3799FB,$96B99F07C9AEF97E
	Data.q $C41D2038CF73E3A1,$E6C0350DD957742A,$BC94BFE01C679F86,$000002FFD2EBF466,$42AE444E45490000
	Data.q $0000000000008260
EndDataSection
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Aktuelles Projekt: Lizard - Skriptsprache für symbolische Berechnungen und mehr
True29
Beiträge: 283
Registriert: 18.08.2012 19:18
Computerausstattung: Windows 8 64bit .Profan x2,Purebasic 5.5
Wohnort: Worms
Kontaktdaten:

Re: Welcher teil des Codes is für die Gravitation verantwort

Beitrag von True29 »

ehm ja , ich hab mir schon sehr den kopf darüber zerbrochen. Und irgendwann macht dann programmieren kein spaß mehr.

Dein Code verhält sich anderst gegen über dem oben :(
und dem gezeigtem Video.

danke trotzdem ich denke mal das sollte mir weiter helfen.


update.
Wäre cool wenn das vielleicht noch wer bisl anpasst in richtung Orginalcode.
Grüße
i7,12gb ram , Windows 10 ,Purebasic 5.50
Antworten