Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Di Jul 15, 2025 17:21

Foren-Übersicht » Programmierung » OpenGL
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 7 Beiträge ] 
Autor Nachricht
BeitragVerfasst: Mo Jul 26, 2004 12:51 
Offline
Guitar Hero
Benutzeravatar

Registriert: Do Sep 25, 2003 15:56
Beiträge: 7810
Wohnort: Sachsen - ERZ / C
Programmiersprache: Java (, Pascal)
Also folgendes.
Ich arbeite gerade an nem winzigen Projekt zur darstellung von Baumstrukturen.
Ich hab einfach paar Kugeln (gluSphere) genommen und hab die mit nem TextureFont beschriftet.

Die Koordinaten hab ich über gluProject geholt. Leider funktioniert die Darstellung nun noch gar net richtig.

Kann mal jemand das Projekt bei sich testen und sagen was falschläuft?

Als Textureloader hab ich die UGLText von Dopefish in Verwendung (im Ordner enthalten).
Der Loader wird ständig weiterentwickelt (immer wenn anregungen gemacht werden) und nutzt die Fonts die mit dem FontBuilder von Mars erzeugt werden.

DopeFish wollte den Loader eigentlich mal hier vorstellen, hats aber immer noch net gemacht. (@DopeFish: *PistoleAufBrustSetz* MACHEN!)

_________________
Blog: kevin-fleischer.de und fbaingermany.com


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Jul 26, 2004 14:54 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Got a url to glbitmap.pas ? (not included in zip)

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Jul 26, 2004 17:39 
Offline
DGL Member
Benutzeravatar

Registriert: Do Dez 05, 2002 10:35
Beiträge: 4234
Wohnort: Dortmund
glBitmap

Do you need glBitmap for this project? I don't.


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Jul 26, 2004 18:15 
Offline
Guitar Hero
Benutzeravatar

Registriert: Do Sep 25, 2003 15:56
Beiträge: 7810
Wohnort: Sachsen - ERZ / C
Programmiersprache: Java (, Pascal)
Yes, for the UGLText you need it.

_________________
Blog: kevin-fleischer.de und fbaingermany.com


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Jul 26, 2004 20:31 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Code:
  1.  
  2.      with Form1 do begin
  3.          gluProject(w^.XPos,w^.level,ZOOM,ModelMat, ProjMat, Viewport, @X,@Y,@Z);
  4.          Font.OrthoStart(Form1.Width, Form1.Height);
  5.          Font.SetSize(600,600);
  6.          Font.SetColor(1.0,1.0,1.0);
  7.          Font.SetAlignment(haLeft,vaTop);
  8.          Font.Print(X,Y,IntToStr(w^.data));
  9.          Font.OrthoStop;
  10.      end;
  11.  


changed to

Code:
  1.  
  2.      with Form1 do begin
  3.          gluProject(w^.XPos,w^.level,ZOOM,ModelMat, ProjMat, Viewport, @X,@Y,@Z);
  4.          Font.OrthoStart(Form1.Width, Form1.Height);
  5.          Font.SetSize(600,600);
  6.          Font.SetColor(1.0,1.0,1.0);
  7.          Font.SetAlignment(haLeft,vaTop);
  8.          Font.Print(X,Form1.Height-Y,IntToStr(w^.data));
  9.          Font.OrthoStop;
  10.      end;
  11.  


Makes the figures stick. Basicaly Form1.Height- is added b4 the Y.

The text unit seems to have 0,0 as the top left not bottom left.

EDIT: just realised that not all figures stick to the spheres..... but there static. (in the 3d world relation)

EDIT2:

Code:
  1.  
  2. with Form1 do begin
  3.          gluProject(w^.XPos,-w^.level,ZOOM,ModelMat, ProjMat, Viewport, @X,@Y,@Z);
  4.          Font.OrthoStart(Form1.Width, Form1.Height);
  5.          Font.SetSize(600,600);
  6.          Font.SetColor(1.0,1.0,1.0);
  7.          Font.SetAlignment(haLeft,vaTop);
  8.          Font.Print(X,Form1.Height-Y,IntToStr(w^.data));
  9.          Font.OrthoStop;
  10.      end;
  11.  


Adding a - b4 w^.level means the figues stick to the spheres, unless zoom is changed. I don't know how u could work out the X and Y with a Zoom, without resorting to making the text act like sprites.

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Jul 26, 2004 22:36 
Offline
Guitar Hero
Benutzeravatar

Registriert: Do Sep 25, 2003 15:56
Beiträge: 7810
Wohnort: Sachsen - ERZ / C
Programmiersprache: Java (, Pascal)
Thanks. Now the translations works correct.

But what do I do wrong, that the text is not in the center of the spheres? Even if I use Font.SetAlignment(haCentre, vaCentre) it is not in position. The more the text is out of the middle of the Form, the more he is displaced. (Hope you understand...)

_________________
Blog: kevin-fleischer.de und fbaingermany.com


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Jul 26, 2004 22:56 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
It may b the Z factor. Without working out how much Z affects X and Y u can't compleatly translate the 3d cordinates to 2d. My 3d maths is crap.

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 7 Beiträge ] 
Foren-Übersicht » Programmierung » OpenGL


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 17 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.007s | 14 Queries | GZIP : On ]