AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Projekte Andorra 2D [Ver. 0.4.5.1, 31.12.08]

Andorra 2D [Ver. 0.4.5.1, 31.12.08]

Ein Thema von igel457 · begonnen am 24. Nov 2006 · letzter Beitrag vom 14. Sep 2011
Antwort Antwort
Seite 92 von 101   « Erste     4282909192 9394     Letzte » 
Benutzerbild von 3_of_8
3_of_8

Registriert seit: 22. Mär 2005
Ort: Dingolfing
4.129 Beiträge
 
Turbo Delphi für Win32
 
#1

Re: Andorra 2D [Ver. 0.4.5.1, 31.12.08]

  Alt 18. Jan 2009, 10:59
Kein Problem. Jetzt sind eh nur noch drei übrig, mal schauen, wann ich die angreife.
Manuel Eberl
„The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.“
- Terry Pratchett
  Mit Zitat antworten Zitat
Romi

Registriert seit: 25. Apr 2007
72 Beiträge
 
#2

Re: Andorra 2D [Ver. 0.4.5.1, 31.12.08]

  Alt 18. Jan 2009, 21:14
Zitat von 3_of_8:
Kein Problem. Jetzt sind eh nur noch drei übrig, mal schauen, wann ich die angreife.
Ich hatte die letzten Wochen viel zu tun, deshalb dauerts etwas, aber Particle ist bei mir halb fertig. Nur das du damit nicht anfängst
  Mit Zitat antworten Zitat
Benutzerbild von Codewalker
Codewalker

Registriert seit: 18. Nov 2005
Ort: Ratingen
945 Beiträge
 
Delphi XE2 Professional
 
#3

Re: Andorra 2D [Ver. 0.4.5.1, 31.12.08]

  Alt 21. Jan 2009, 14:36
Ich hätte noch eine Anregung/Bitte: Könnte man jedem Item in der TAdImageList noch ein String-Feld hinzufügen, dass man zur freien Verwendung nutzen kann und per AdImgEdit auch mit Text belegen kann? Hintergrund: Ich würde gerne Bilder in der Liste mit Tags/Kategorien versehen. Wäre so etwas möglich oder habt ihr eine alternative Idee? (Der Name des Bildes kommt nicht in Frage, soll schon ein anderes Feld sein)
  Mit Zitat antworten Zitat
Benutzerbild von xZise
xZise

Registriert seit: 3. Mär 2006
Ort: Waldbronn
4.303 Beiträge
 
Delphi 2009 Professional
 
#4

Re: Andorra 2D [Ver. 0.4.5.1, 31.12.08]

  Alt 21. Jan 2009, 15:42
Naja du könnest gucken, ob du vielleicht an den Bilddaten noch Informationen dranhängen kannst?

MfG
xZise
Fabian
Eigentlich hat MS Windows ab Vista den Hang zur Selbstzerstörung abgewöhnt – mkinzler
  Mit Zitat antworten Zitat
Florian H

Registriert seit: 30. Mär 2003
Ort: Mühlacker
1.043 Beiträge
 
Delphi 6 Professional
 
#5

Re: Andorra 2D [Ver. 0.4.5.1, 31.12.08]

  Alt 23. Jan 2009, 16:55
Gibts eigentlich irgendwo eine Demo oder ein Tut bezüglich "Lights"?
Würde mir das gerne mal anschauen, aber das ganze rein über die Doku zu machen ist sehr anstrengend und oft von Misserfolg gekrönt ...
Florian Heft
  Mit Zitat antworten Zitat
Benutzerbild von igel457
igel457

Registriert seit: 31. Aug 2005
1.622 Beiträge
 
FreePascal / Lazarus
 
#6

Re: Andorra 2D [Ver. 0.4.5.1, 31.12.08]

  Alt 23. Jan 2009, 17:12
Hallo,

"Lights" sind eigentlich nur am besten für 3D-Modelle geeignet. Schau dir mal die "Simple3D"-Demo an, dort verwende ich ein Lichtobjekt.

Für reine 2D-Anwendungen würde ich (wie in der Bounce-Demo) einen Lichtkreis additiv auf die Szene zeichnen.

Edit:
@Codewalker: Ich habe vor irgendwann das ImageList-Dateiformat auf etwas dynamischeres Abzuändern, ich hatte da an etwas XML-Basiertes mit Binärdatenteil gedacht. Aber vorerst möchte ich noch nichts daran ändern.

@FlorianH: Wegen deinem Problem mit den Surfaces: Eine (suboptimale) Lösung ist, den Hintergrund nicht in der GPU zu rendern, sondern das ganze in die CPU auszulagern. "TAdBitmap"s kannst du mit TAdBitmap.DrawBitmap aufeinanderzeichnen. Dabei musst du ja nur die veränderten Farbkleckse zeichnen. Woran das Problem mit dem DirectX-FBO liegt, habe ich bis jetzt noch keine Ahnung - bei mir (Radeon 9800/ HD 4650) funktioniert es ja.
Andreas
"Sollen sich auch alle schämen, die gedankenlos sich der Wunder der Wissenschaft und Technik bedienen, und nicht mehr davon geistig erfasst haben als die Kuh von der Botanik der Pflanzen, die sie mit Wohlbehagen frisst." - Albert Einstein
  Mit Zitat antworten Zitat
Benutzerbild von igel457
igel457

Registriert seit: 31. Aug 2005
1.622 Beiträge
 
FreePascal / Lazarus
 
#7

Re: Andorra 2D [Ver. 0.4.5.1, 31.12.08]

  Alt 28. Jan 2009, 21:16
Hallo,

gerade habe ich in Andorra 2D die Möglichkeit zum Laden von 3D-Modellen eingebaut. Wie alles andere auch, findet das Laden in modularer Weise statt. So können Loader für die verschiedenen Modelformate einfach durch hinzufügen zur Uses-Klausel eingebunden werden (so mache ich das ja auch schon bei den Bildformaten.)

Momentan arbeite ich an einem Loader für 3DS (Danke hierbei an Noeska, dessen Bibliothek "glModel" ich hierbei teilweise als Referenz für das 3DS Dateiformat missbrauche). Die entsprechende Unit gibt es hier zum Anschauen: http://andorra.cvs.sourceforge.net/v...as?view=markup

Aktuell lade ich weder Texturen/-koordinaten noch Materialien aus der 3DS-Datei, doch das kommt in den nächsten Tagen noch.

Weitere Formate, die ich unterstützen möchte sind .X und .OBJ

Außerdem habe ich einen "Maskottchen Wettbewerb" gestartet, bei dem ich ein 3D-Maskottchen für die Verwendung in den 3D-Demos von Andorra 2D suche.
Siehe: http://www.delphipraxis.net/internal...t.php?t=151171

Kommentare sind wie immer erwünscht,
Andreas
Andreas
"Sollen sich auch alle schämen, die gedankenlos sich der Wunder der Wissenschaft und Technik bedienen, und nicht mehr davon geistig erfasst haben als die Kuh von der Botanik der Pflanzen, die sie mit Wohlbehagen frisst." - Albert Einstein
  Mit Zitat antworten Zitat
Benutzerbild von Codewalker
Codewalker

Registriert seit: 18. Nov 2005
Ort: Ratingen
945 Beiträge
 
Delphi XE2 Professional
 
#8

Re: Andorra 2D [Ver. 0.4.5.1, 31.12.08]

  Alt 29. Jan 2009, 09:54
Supi, dann kann ich in meinem Spiel vielleicht das Würfeln tatsächlich mit fallenden Würfeln darstellen (wobei man ja dann noch die Newton-Physics für Modelle oder Boxen bräuchte. Planst du das zufällig auch?).

Wann gibt es denn von dir den nächsten zusammengepackten Release?
  Mit Zitat antworten Zitat
Benutzerbild von 3_of_8
3_of_8

Registriert seit: 22. Mär 2005
Ort: Dingolfing
4.129 Beiträge
 
Turbo Delphi für Win32
 
#9

Re: Andorra 2D [Ver. 0.4.5.1, 31.12.08]

  Alt 29. Jan 2009, 14:46
Es gibt ein altes Projekt von mir, in dem Loader für MD2 und MS3D sowie Anbindungen an Newton enthalten sind - wenn ich mal viel Zeit habe, kann ich schauen, in wie weit ich das in Andorra integrieren kann.
Manuel Eberl
„The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.“
- Terry Pratchett
  Mit Zitat antworten Zitat
Benutzerbild von 3_of_8
3_of_8

Registriert seit: 22. Mär 2005
Ort: Dingolfing
4.129 Beiträge
 
Turbo Delphi für Win32
 
#10

Re: Andorra 2D [Ver. 0.4.5.1, 31.12.08]

  Alt 27. Mär 2009, 21:27
Another wee translation for ye.

(Es heißt im Übrigen "das Partikel", nicht "der Partikel". "die Partikel (sing.)" gibt es auch, aber damit ist ein Wort gemeint, das nicht gebeugt wird)

Zitat:
Andorra 2D tutorials
Particle systems


What are particle systems?
You want to use graphical effects such as explosions or magic spells many times in your game.
To do this, so-called "particle systems" are often used. As the name suggests, particle systems consist of single "particles", which in turn are mostly rather unspectacularly looking images that move in a certain direction and disappear again after some time:
http://andorra.sourceforge.net/tutots/particle.png
If you have several of these particles, you get this effect:
http://andorra.sourceforge.net/tutots/part1.png
The particle system manages the particles and their movements.

Particle systems Andorra 2D

Loading particles
In Andorra 2D, there is the class "TAdParticleSystem" in the unit "AdParticles".
The class expects a parameter of the type "TAdDraw" in its constructor specifying the surface which the output should be displayed on.
To create particles, you have to assign the particle's image first.
This is done by the following code:
Delphi-Quellcode:
//Creating the particle system
partsys := TAdParticleSystem.Create(AdDraw);
//Assigning the image
partsys.Texture := AdImageList.Items[0].Texture;
To achieve the best effect, make sure the particle has an alpha channel. Use this image, for example. (Note that in order to load PNG images you have to include the AdPNG unit and the library PNGDelphi has to be in the search path, if needed).

Now we're already done. Add the following line to your rendering routine:
partsys.Emit(1, 0, 0); This line adds a new particle to the particle system at the position 0,0. The particle system has its own coordinate system in which the particles move. We create our new particle at the origin of ordinates.

Now we have to tell the particle systems to move its particles and draw them. This is done by the following lines:
Delphi-Quellcode:
PartSys.Move(AdPerCounter.TimeGap / 1000);
partsys.Draw(bmAdd, AdDraw.DisplayRect.Right / 2, AdDraw.DisplayRect.Bottom / 2);
The coordinate system's point of origin is temporarily moved to the centre point of the screen, so that new particles also appear there.
Do not forget to also free the particle system in the end and execute the programme:
http://andorra.sourceforge.net/tutots/part3.png

If you want to have the source code, take a look at the demo "demos\Particles\Simple\simplepart". Or take a look at this: http://andorra.cvs.sourceforge.net/a...iew=markup#l_1

The behaviour of particles
As you have seen, the particles have a default behaviour. But where does it come from?
To find that out, we take a look at how the "emit" function of the particle system works in detail:
http://andorra.sourceforge.net/tutots/creation.png
In the beginning, the specified amount of particles is created, which inherit their properties from the particle system's "default particle". Then the fuction "SetupMovement" of each particle is called, in which a movement vector is generated.
To change the overall appearance of the particle system, you only have to adjust the properties of the default particle. To adjust the life time of the particles, for example, write the following:
PartSys.DefaultParticle.LifeTime := 2; //Specified in seconds You can adjust the particles' properties with the comfortable particle editor (parted.exe). Just play around with it a bit. You can also write the particles into a file with it and load them again with:
PartSys.DefaultParticle.LoadFromFile('particle.apf'); Note that the image you have loaded into the particle editor is not saved into the file.

That was virtually everything there is to say about particles.

Custom particle classes
If you want to create particles with a chaotic movement pattern, you can derive your own particle class, which you can pass on to the particle system by assigning the default particle. Take a look at the source code of TAdStdParticle or TAdBillboardParticle respectively. It's the easiest way to derive your own particle class from those.

Particles in the sprite engine
The class "TParticleSprite" exists to use particle systems in the sprite engine. It has its own particle system. You can also tell it how many particles to create per second. This, however, is a chapter on its own and will be covered separately in the sprite engine tutorials.

Copyright and licence
(c) by Andreas Stöckel February 2007
Translation by 3_of_8 (Manuel Eberl)

The content of this tutorial is subject to the GNU Licence for Free Documentation.
Manuel Eberl
„The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.“
- Terry Pratchett
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 92 von 101   « Erste     4282909192 9394     Letzte » 

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

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 04:38 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