AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Projekte Balanced das Spiel für Starke Nerven und Starke Graphikkarte
Thema durchsuchen
Ansicht
Themen-Optionen

Balanced das Spiel für Starke Nerven und Starke Graphikkarte

Ein Thema von Corpsman · begonnen am 13. Jul 2006 · letzter Beitrag vom 21. Sep 2008
Antwort Antwort
Benutzerbild von Corpsman
Corpsman

Registriert seit: 8. Nov 2005
Ort: nähe Stuttgart
981 Beiträge
 
Delphi XE2 Professional
 
#1

Re: Balanced das Spiel für Starke Nerven und Starke Graphikk

  Alt 19. Jul 2006, 20:25
@TurboMartin

ich hatte es schon mal erklärt, aber ich wiederhohle es gerne.

Die Flammen werden Transparent gemalt.

Das Problem ist das ich nicht weis wie man das macht.

mementan geht es bei mir so

Delphi-Quellcode:
      glShadeModel(GL_SMOOTH); // Povolí jemné stínování
      glClearColor(0.0, 0.0, 0.0, 0.0); // Èerné pozadí
      glClearDepth(1.0); // Nastavení hloubkového bufferu
      glDisable(GL_DEPTH_TEST); // Vypne hloubkové testování
      glEnable(GL_BLEND); // Enable Blending
      glBindTexture(GL_TEXTURE_2D, FFireTexture); // Vybere texturu
      glBlendFunc(GL_SRC_ALPHA, GL_ONE); // Type Of Blending To Perform
      glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations
      glHint(GL_POINT_SMOOTH_HINT, GL_NICEST); // Really Nice Point Smoothing
      inc(ffpscount);
      For i := 0 To high(fparticles) Do Begin
        x := fparticles[i].x; // x pozice
        y := fparticles[i].y; // y pozice
        z := fparticles[i].z; // z pozice
        // Setzen des Alpha Kanals
        glColor4f(fparticles[i].r, fparticles[i].g, fparticles[i].b, fparticles[i].life);
        // Wir malen jedes Paticel 2 Mal damit wir es bei Drehungen auch sehen.
        glBegin(GL_TRIANGLE_STRIP);
        glTexCoord2d(1, 1);
        glVertex3f(x + 0.1, y, z + 0.1);
        glTexCoord2d(0, 1);
        glVertex3f(x - 0.1, y, z + 0.1);
        glTexCoord2d(1, 0);
        glVertex3f(x + 0.1, y, z - 0.1);
        glTexCoord2d(0, 0);
        glVertex3f(x - 0.1, y, z - 0.1);
        glEnd;
        glBegin(GL_TRIANGLE_STRIP);
        glTexCoord2d(1, 1);
        glVertex3f(x, y + 0.1, z + 0.1);
        glTexCoord2d(0, 1);
        glVertex3f(x, y - 0.1, z + 0.1);
        glTexCoord2d(1, 0);
        glVertex3f(x, y + 0.1, z - 0.1);
        glTexCoord2d(0, 0);
        glVertex3f(x, y - 0.1, z - 0.1);
        glEnd;
        If ffps <= ffpscount Then Begin
          fparticles[i].x := fparticles[i].x + fparticles[i].xi / (fslowdown * 1000); // Pohyb na ose x
          fparticles[i].y := fparticles[i].y + fparticles[i].yi / (fslowdown * 1000); // Pohyb na ose y
          fparticles[i].z := fparticles[i].z + fparticles[i].zi / (fslowdown * 1000); // Pohyb na ose z
          fparticles[i].xi := fparticles[i].xi + fparticles[i].xg; // Gravitaèní pùsobení na ose x
          fparticles[i].yi := fparticles[i].yi + fparticles[i].yg; // Gravitaèní pùsobení na ose y
          fparticles[i].zi := fparticles[i].zi + fparticles[i].zg; // Gravitaèní pùsobení na ose z
          fparticles[i].life := fparticles[i].life - fparticles[i].fade; // Sníží život o stárnutí
          If (fparticles[i].life < 0.0) Then Begin
            fparticles[i].life := 1.0;
            fparticles[i].fade := (random(100) / 1000.0) + 0.015;
            fparticles[i].x := 0.0;
            fparticles[i].y := 0.0;
            fparticles[i].z := 0.0;
            fparticles[i].xi := (random(60) - 32.0) / 2;
            fparticles[i].yi := (random(60) - 30.0) / 2;
            fparticles[i].zi := (random(60) - 30.0) / 2;
          End;
        End;
      End;
      If ffps <= ffpscount Then
        ffpscount := 0;
      glDisable(GL_BLEND); // Disable Blending
      glenable(GL_DEPTH_TEST); // Enable Dethtest
Wie man sieht ist das das Partikel Sample von Nehe.gamedev.net allerdings auf meine Bedürfnisse zugeschnitten und mit einem FPS Synchrinisierer.

Wenn du weist wie man es besser macht will ich mich gerne belehren lassen.
Uwe
My Sitewww.Corpsman.de

My marble madness clone Balanced ( ca. 70,0 mb ) aktuell ver 2.01
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:16 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz