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

Aktuelle Zeit: Fr Jul 18, 2025 14:10

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



Ein neues Thema erstellen Auf das Thema antworten  [ 5 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: Würfel sit einsichtig
BeitragVerfasst: So Mai 11, 2008 14:56 
Offline
DGL Member

Registriert: So Mär 02, 2008 18:47
Beiträge: 30
Hallo zusammen,

ich habe irgendwie das Problem, dass ich bei meinem Würfel von aussen rein gucken kann-

Eingestellt habe ich in der Funktion, die meinen Würfel zeichnet

--> gl.glPolygonMode(GLEnum.GL_FRONT_AND_BACK, GLEnum.GL_FILL);


Meine Koordinaten sehen derzeit so aus:


Code:
  1.  
  2.  
  3. gl.glBegin(GLEnum.GL_QUADS);                                      // Start Drawing The Cube#
  4.        
  5.          
  6.              tex.setTexture(1);                      // Set The Color To BLUE    WAND links
  7.             gl.glTexCoord2f(0.0f, y);       gl.glVertex3f( -x,   y, -z);                  // Top Right Of The Quad (Top)
  8.             gl.glTexCoord2f(x, y);          gl.glVertex3f( -x,   y,  z);                  // Top Left Of The Quad (Top)
  9.             gl.glTexCoord2f(x, 0.0f);       gl.glVertex3f( -x,  -y,  z);                  // Bottom Left Of The Quad (Top)
  10.             gl.glTexCoord2f(0.0f, 0.0f);    gl.glVertex3f( -x,  -y, -z);                  // Bottom Right Of The Quad (Top)
  11.            
  12.              // Set The Color To GRAU   WAND RECHTS
  13.             gl.glTexCoord2f(x, 0.0f);       gl.glVertex3f( x, -y,   z);                  // Top Right Of The Quad (Bottom)
  14.             gl.glTexCoord2f(0.0f, 0.0f);    gl.glVertex3f( x, -y, - z);                  // Top Left Of The Quad (Bottom)
  15.             gl.glTexCoord2f(0.0f,   y);     gl.glVertex3f( x,  y,  -z);                  // Bottom Left Of The Quad (Bottom)
  16.             gl.glTexCoord2f(x,    y);       gl.glVertex3f( x,  y,   z);                  // Bottom Right Of The Quad (Bottom)
  17.            
  18.            
  19.             //DECKE
  20.             gl.glTexCoord2f(0.0f,    y);       gl.glVertex3f( -x, y,   z);                  // Top Right Of The Quad (Front)
  21.             gl.glTexCoord2f(x,       y);       gl.glVertex3f(  x, y,   z);                  // Top Left Of The Quad (Front)
  22.             gl.glTexCoord2f(x,    0.0f);       gl.glVertex3f(  x, y,  -z);                  // Bottom Left Of The Quad (Front)
  23.             gl.glTexCoord2f(0.0f, 0.0f);       gl.glVertex3f( -x, y, - z);                  // Bottom Right Of The Quad (Front)
  24.        
  25.                           // Set The Color To Yellow  FUSSBODEN
  26.             gl.glTexCoord2f(0.0f, 0.0f);          gl.glVertex3f( -x, -y,  -z);                  // Top Right Of The Quad (Back)
  27.             gl.glTexCoord2f(x,    0.0f);          gl.glVertex3f(  x, -y,  -z);                  // Top Left Of The Quad (Back)
  28.             gl.glTexCoord2f(x,       y);          gl.glVertex3f(  x, -y,   z);                  // Bottom Left Of The Quad (Back)
  29.             gl.glTexCoord2f(0.0f,    y);          gl.glVertex3f( -x, -y,   z);                  // Bottom Right Of The Quad (Back)
  30.      
  31.            // gl.glColor3f(0.0f,1.0f,0.0f);                      // Set The Color To Blue    FRONT
  32.             gl.glTexCoord2f(0.0f, 0.0f);     gl.glVertex3f(-x, -y, z);                  // Top Right Of The Quad (Left)
  33.             gl.glTexCoord2f(x, 0.0f);     gl.glVertex3f( x, -y, z);                  // Top Left Of The Quad (Left)
  34.             gl.glTexCoord2f(x, y);        gl.glVertex3f( x,  y, z);                  // Bottom Left Of The Quad (Left)
  35.             gl.glTexCoord2f(0.0f, y);     gl.glVertex3f(-x,  y, z);                  // Bottom Right Of The Quad (Left)
  36.  
  37. //          tex.setTexture(1);    // RÜCKWAND
  38.             gl.glTexCoord2f(x,    0.0f);    gl.glVertex3f( x,  -y, -z);                  // Top Right Of The Quad (Right)
  39.             gl.glTexCoord2f(0.0f, 0.0f);    gl.glVertex3f(-x,  -y, -z);                  // Top Left Of The Quad (Right)
  40.             gl.glTexCoord2f(0.0f,    y);    gl.glVertex3f(-x,   y, -z);                  // Bottom Left Of The Quad (Right)
  41.             gl.glTexCoord2f(x,       y);    gl.glVertex3f( x,   y, -z);                  // Bottom Right Of The Quad (Right)
  42.  
  43.      gl.glEnd();        
  44.  
  45.  
  46.  


Ich komme hier irgendwie nicht weiter. So genau weiss ich auch nicht, ob alle Textur Koordinaten zu den jeweiligen Vertex Koordinaten passen...

Viele Grüße
soa


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Mai 11, 2008 15:39 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 29, 2003 00:11
Beiträge: 436
Tiefentest deaktiviert?
Schmeiß das hier mal in dein Init:
gl.glEnable(GL.GL_DEPTH_TEST);


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Mai 11, 2008 19:00 
Offline
DGL Member
Benutzeravatar

Registriert: Do Sep 02, 2004 19:42
Beiträge: 4158
Programmiersprache: FreePascal, C++
Probier mal, obs mit ausgeschaltetem Backfaceculling funzt.

Gruß Lord Horazont

_________________
If you find any deadlinks, please send me a notification – Wenn du tote Links findest, sende mir eine Benachrichtigung.
current projects: ManiacLab; aioxmpp
zombofant networkmy photostream
„Writing code is like writing poetry“ - source unknown


„Give a man a fish, and you feed him for a day. Teach a man to fish and you feed him for a lifetime. “ ~ A Chinese Proverb


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Mai 12, 2008 11:52 
Offline
DGL Member

Registriert: So Mär 02, 2008 18:47
Beiträge: 30
Backface Culling muss ich hier im WIKI erst einmal nachschauen :-)

Aber: gl.glEnable(GL.GL_DEPTH_TEST);

Das ist es .. ein Traum . Man arbeitet selbst so lange an einem Problem und dann ist es eine kleine Einstellung...

Herzlichen Dank .


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Mai 12, 2008 20:10 
Offline
DGL Member
Benutzeravatar

Registriert: Di Apr 29, 2008 15:18
Beiträge: 62
Hallo,

das Problem hatte ich auch: Hier. Auch in meinem Fall war der Tiefenpuffer die rettende Antwort :D

Grüße,
Yogu


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


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 5 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:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.007s | 14 Queries | GZIP : On ]