Source wurde am 15.07.2007 aus qui MMJ-Quellcodesammlung (Dietmar Horn) dans qui Babyklappe sur XProfan.Com abgelegt:
OGL-Demo: Planeten
Déclarer Texture%[4],
DisplayList%[3],
Rotation![3],
SelfRot![3],
LightPos&[3]
Déclarer rouge!, Ende%, Namen$[4]
proc DrawGLScene
oGL(Claire)
oGL(Origin, 0, -2.8, (-50))
oGL(Rotate, rouge!, 0, 0)
soleil
oGL(SetName, 0)
oGL(Texture, Texture%[0], 1)
oGL(Push)
oGL(Rotate, 0, SelfRot![0], 0)
oGL(Sphere, 2.8, 32, 32)
oGL(Pop)
Mars
oGL(SetName, 1)
oGL(Texture, Texture%[1], 1)
oGL(Push)
oGL(Rotate, 0, Rotation![1], 0)
oGL(Move, 0.0, 1.2, 20.0)
oGL(Rotate, 0, SelfRot![1], 0)
oGL(Sphere, 1.6, 32, 32)
oGL(Pop)
Erde
oGL(SetName, 2)
oGL(Texture, Texture%[2], 1)
oGL(Push)
oGL(Rotate, 0, Rotation![2], 0)
oGL(Move, 0.0, 0.8, 10.0)
oGL(Rotate, 0, SelfRot![2], 0)
oGL(Sphere, 2.0, 32, 32)
Mond
oGL(SetName, 3)
oGL(Texture, Texture%[3], 1)
oGL(Rotate, 0, Rotation![3], 0)
oGL(Move, 0.0, 1.2, 3.5)
oGL(Sphere, 0.8, 16, 16)
oGL(Pop)
Hintergrund
oGL(SetName, 4)
oGL(Texture, Texture%[4], 2)
oGL(Rotate, -rouge!, 0, 0) qui Hintergrund soll pas rotieren
oGL(Move, 0, -35, -30)
oGL(Quad, 94, 70)
oGL(Rotate, rouge!, 0, 0)
oGL(Show)
ENDPROC
Titre de la fenêtre Planeten
Fenêtre Style 31
CLS
Messagebox(Linksklick sur objet: Objektname dans qui Titelleiste
+
Droit: Titelleiste wird zurückgesetzt
+
BildHoch/BildRunter kippen cela System, OpenGL-Demo qPlanetenq, 64)
oGL(Init, %hWnd, 0, 0, 0, 1)
texture%[0] = oGL(LoadTextureBMP,sun.bmp,3)
texture%[1] = oGL(LoadTextureBMP,mars.bmp,3)
texture%[2] = oGL(LoadTextureBMP,earth.bmp,3)
texture%[3] = oGL(LoadTextureBMP,moon.bmp,3)
texture%[4] = oGL(LoadTextureBMP,space.bmp,3)
Namen$[0] = soleil
Namen$[1] = Mars
Namen$[3] = Mond
Namen$[2] = Erde
Namen$[4] = Sterne
Ende% = 0
setTimer 50 max. 20 Frames /sek.
WhileNot ende%
WaitInput
Si IsKey(27)
Ende% = 1
EndIf
Si IsKey(1)
oGL(StartTest, %MouseX, %MouseY)
DrawGLScene()
SetText %hWnd, namen$[oGL(EndTest)]
ElseIf IsKey(2)
SetText %hWnd, Planeten
ElseIf IsKey(34)
rouge! = rouge! + 1
ElseIf IsKey(33)
rouge! = rouge! - 1
EndIf
SelfRot![0] = SelfRot![0] + 0.5 soleil
SelfRot![1] = SelfRot![1] + 5 Mars
SelfRot![2] = SelfRot![2] + 5 Erde
SelfRot![3] = SelfRot![3] + 5 Mond
WhileLoop 0, 3
Cas SelfRot![&loop] > 360 : SelfRot![&loop] = 0
Endwhile
Rotation![3] = Rotation![3] - 12.5 Mond
Rotation![2] = Rotation![2] + 2.5 Erde
Rotation![1] = Rotation![1] + 1.5 Mars
WhileLoop 1, 3
Cas Rotation![&loop] > 360 : Rotation![&loop] = 0
Cas Rotation![&loop] < 0 : Rotation![&loop] = 360
Endwhile
DrawGLScene()
Endwhile
killTimer
end