AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Dreidimensionales Array darstellen.

Ein Thema von Muellermilchtrinker · begonnen am 11. Aug 2010 · letzter Beitrag vom 24. Aug 2010
 
Benutzerbild von Muellermilchtrinker
Muellermilchtrinker

Registriert seit: 1. Aug 2009
447 Beiträge
 
Delphi 2009 Professional
 
#22

AW: Dreidimensionales Array darstellen.

  Alt 24. Aug 2010, 11:32
Und sag, was ist Urlaub!?
Weißt du das nicht??? Man geht da in ein anderes Land/Gebiet/Stadt und entspannt sich dort.

Aber back to topic:

PROBLEM GELÖST
Ich hab das Problem gelöst (ohne gluOrtho2D ). Mir wurde auf DGL geraten diese Zeile:
gluPerspective(45.0, ClientWidth/ClientHeight, NearClipping, FarClipping); durch diese Zeile zu ersetzen:
gluPerspective(45.0, panel1.ClientWidth/panel1.ClientHeight, NearClipping, FarClipping); Und es hat geklappt. Begründung: mit meinem vorherigen Code hab ich alles auf die Formulargröße gesetzt. MIt diesem Code mach ich das auf mein Panel und das ist ja so schön quadratisch. Und jetzt ist mein Würfel ein Würfel.

Weiter gehts:

Ich hab mir jetzt diese Prozedur geschrieben:
Delphi-Quellcode:
procedure TForm1.Cube(Color:Integer);
begin
    if Color <> 0 then glColor4f(0.5, 0.5, 1.0, 0.8) // Set The Color
    else glColor4f(0.3, 0.3, 0.3, 0.4);
      glVertex3f( 1.0, 1.0,-1.0);         // Top Right Of The Quad (Top)
      glVertex3f(-1.0, 1.0,-1.0);         // Top Left Of The Quad (Top)
      glVertex3f(-1.0, 1.0, 1.0);         // Bottom Left Of The Quad (Top)
      glVertex3f( 1.0, 1.0, 1.0);         // Bottom Right Of The Quad (Top)

    if Color <> 0 then glColor4f(0.5, 0.5, 1.0, 0.8) // Set The Color
    else glColor4f(0.3, 0.3, 0.3, 0.4);
      glVertex3f( 1.0,-1.0, 1.0);         // Top Right Of The Quad (Bottom)
      glVertex3f(-1.0,-1.0, 1.0);         // Top Left Of The Quad (Bottom)
      glVertex3f(-1.0,-1.0,-1.0);         // Bottom Left Of The Quad (Bottom)
      glVertex3f( 1.0,-1.0,-1.0);         // Bottom Right Of The Quad (Bottom)

    if Color <> 0 then glColor4f(0.5, 0.5, 1.0, 0.8) // Set The Color
    else glColor4f(0.3, 0.3, 0.3, 0.4);
      glVertex3f( 1.0, 1.0, 1.0);         // Top Right Of The Quad (Front)
      glVertex3f(-1.0, 1.0, 1.0);         // Top Left Of The Quad (Front)
      glVertex3f(-1.0,-1.0, 1.0);         // Bottom Left Of The Quad (Front)
      glVertex3f( 1.0,-1.0, 1.0);         // Bottom Right Of The Quad (Front)

    if Color <> 0 then glColor4f(0.5, 0.5, 1.0, 0.8) // Set The Color
    else glColor4f(0.3, 0.3, 0.3, 0.4);
      glVertex3f( 1.0,-1.0,-1.0);         // Bottom Left Of The Quad (Back)
      glVertex3f(-1.0,-1.0,-1.0);         // Bottom Right Of The Quad (Back)
      glVertex3f(-1.0, 1.0,-1.0);         // Top Right Of The Quad (Back)
      glVertex3f( 1.0, 1.0,-1.0);         // Top Left Of The Quad (Back)

    if Color <> 0 then glColor4f(0.5, 0.5, 1.0, 0.8) // Set The Color
    else glColor4f(0.3, 0.3, 0.3, 0.4);
      glVertex3f(-1.0, 1.0, 1.0);         // Top Right Of The Quad (Left)
      glVertex3f(-1.0, 1.0,-1.0);         // Top Left Of The Quad (Left)
      glVertex3f(-1.0,-1.0,-1.0);         // Bottom Left Of The Quad (Left)
      glVertex3f(-1.0,-1.0, 1.0);         // Bottom Right Of The Quad (Left)

    if Color <> 0 then glColor4f(0.5, 0.5, 1.0, 0.8) // Set The Color
    else glColor4f(0.3, 0.3, 0.3, 0.4);
      glVertex3f( 1.0, 1.0,-1.0);         // Top Right Of The Quad (Right)
      glVertex3f( 1.0, 1.0, 1.0);         // Top Left Of The Quad (Right)
      glVertex3f( 1.0,-1.0, 1.0);         // Bottom Left Of The Quad (Right)
      glVertex3f( 1.0,-1.0,-1.0);         // Bottom Right Of The Quad (Right)
end;
Damit mache ich mein Cube und kann die Farbe beeinflussen. aber das ist ja nur ein Cube. Ich brauch aber mehrere (genau: 125). Wie schaffe ich die Verschiebung (je nach Koordinate)??? Zwischen den Cubes sollte auch ein bisschen Platz sein.
Chuck Norris doesn't need backups. He just uploads his files and lets the world mirror them.
  Mit Zitat antworten Zitat
 


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 23:35 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