AGB  ·  Datenschutz  ·  Impressum  







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

wieder konvertierungs problem

Ein Thema von EWeiss · begonnen am 21. Mär 2007 · letzter Beitrag vom 25. Mär 2007
 
EWeiss
(Gast)

n/a Beiträge
 
#6

Re: wieder konvertierungs problem

  Alt 21. Mär 2007, 17:44
Zitat von shmia:
Oder ganz elegant als Einzeiler:
meterlphi := Max(Min(meterlphi, 128.0), 0.0);
Das kommt der IIF anweisung in VB am nächsten
Nur so nebenbei.

Habe noch ein problem bei der For Schleife
Hier mal die Schleife in C++

Code:
      for (lphi=0.0f; lphi<=189.0f; lphi+=13.5f)
      {
         z=-9.0f;
         x=(float)(-sin((lphi+45.0f)*M_PI/180.0f)*2.0f)-2.5f;
         y=(float)(-cos((lphi+45.0f)*M_PI/180.0f)*2.0f)+yposition;

         glTexCoord2f(0.0f,0.0f);   glVertex3f(x-hd,y-hd,z);
         glTexCoord2f(0.0f,1.0f);   glVertex3f(x-hd,y+hd,z);
         glTexCoord2f(1.0f,1.0f);   glVertex3f(x+hd,y+hd,z);
         glTexCoord2f(1.0f,0.0f);   glVertex3f(x+hd,y-hd,z);

         x+=5.0f;
         glTexCoord2f(0.0f,0.0f);   glVertex3f(x-hd,y-hd,z);
         glTexCoord2f(0.0f,1.0f);   glVertex3f(x-hd,y+hd,z);
         glTexCoord2f(1.0f,1.0f);   glVertex3f(x+hd,y+hd,z);
         glTexCoord2f(1.0f,0.0f);   glVertex3f(x+hd,y-hd,z);
      }

Delphi-Quellcode:
Var
  lphi : GLfloat;
  rphi : GLfloat;
Delphi-Quellcode:
      for lphi := 0.0 to 189.0 do lphi := lphi + 13.5;
      begin
         z := -9.0;
         x := (-sin((lphi+45.0)*M_PI/180.0)*2.0)-2.5;
         y := (-cos((lphi+45.0)*M_PI/180.0)*2.0)+yposition;

         glTexCoord2f(0.0,0.0);   glVertex3f(x-hd,y-hd,z);
         glTexCoord2f(0.0,1.0);   glVertex3f(x-hd,y+hd,z);
         glTexCoord2f(1.0,1.0);   glVertex3f(x+hd,y+hd,z);
         glTexCoord2f(1.0,0.0);   glVertex3f(x+hd,y-hd,z);

         x := 5.0;
         glTexCoord2f(0.0,0.0);   glVertex3f(x-hd,y-hd,z);
         glTexCoord2f(0.0,1.0);   glVertex3f(x-hd,y+hd,z);
         glTexCoord2f(1.0,1.0);   glVertex3f(x+hd,y+hd,z);
         glTexCoord2f(1.0,0.0);   glVertex3f(x+hd,y-hd,z);
      end;
jetzt meckert der compiler über diese zeile
for lphi := 0.0 to 189.0 do
Zitat:
[Pascal Error] VisCDRom.pas(775): E2032 For loop control variable must have ordinal type
Ich benötige aber die Variablen als GLfloat
Es muss doch möglich sein in einer schleife GLFloat zu verarbeiten.!

Hier sagt er
lphi := lphi + 13.5;
Zitat:
[Pascal Hint] VisCDRom.pas(775): H2135 FOR or WHILE loop executes zero times - deleted
Gruss Emil
  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 15:15 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