| |
|
|
p.specht
| One äusserst erhaltenswertes example for OGL-skills of XProfan. I hope, Jonathan is these further publication right. Please ev. circa nachträgliches OK! LG p.woodpecker
'/// RamschWare(tm) by Jonathan ///
Var DotzAnzahl& = 20
Declare Doetze#[DotzAnzahl&], Temp&
Class Dotz = X!, Y!, Z!, VX!, VY!, VZ!, R!, G!, B!, Seg&, Form&, RotoX!, VRotoX!, RotoY!, VRotoY!
Dim Doetze#[], Dotz
Window Style 16+64+256
Window %maxx, %maxy
Randomize
'Doetze create
WhileLoop 0, DotzAnzahl& - 1
With Doetze#[&loop]
.R! = @Rnd()
.G! = @Rnd()
.B! = @Rnd()
Temp& = @Rnd(3)
If Temp& = 0
.R! = 1
ElseIf Temp& = 1
.G! = 1
ElseIf Temp& = 2
.B! = 1
EndIf
.Seg& = @Rnd(5) + 3
.VX! = (@Rnd() - .5) / 4
.VY! = (@Rnd() - .5) / 4
.VZ! = (@Rnd() - .5) / 4
.Form& = @Rnd(5)
.VRotoX! = @Rnd() * 10 - 5
.VRotoY! = @Rnd() * 10 - 5
EndWith
EndWhile
Ogl("Init", %hwnd, 0, 0, 0, 1)
Ogl("PosMode", 1)
Proc ZeichneDoetze
Parameters Doetze#[], DA&
Ogl("Clear")
WhileLoop 0, DA& - 1
With Doetze#[&loop]
Ogl("Origin", .X!, .Y!, .Z! - 8)
Ogl("Color", .R!, .G!, .B!, 1)
Ogl("Rotate", .RotoX!, .RotoY!, 0)
If .Form& = 0
Ogl("Sphere", .5, .Seg&, .Seg&)
ElseIf .Form& = 1
Ogl("Cuboid", .5, .5, .5)
ElseIf .Form& = 2
Ogl("Triangle", .5, .5, .5)
ElseIf .Form& = 3
Ogl("Tube", .5, .5, .5, .Seg&)
ElseIf .Form& = 4
Ogl("Disk", .5 / 2, .5, .Seg&)
EndIf
EndWith
EndWhile
Ogl("Show")
ENDPROC
ZeichneDoetze Doetze#[], DotzAnzahl&
SetTimer 30
WhileNot @Iskey(27)
WhileLoop 0, DotzAnzahl& - 1
With Doetze#[&loop]
.X! = .X! + .VX!
.Y! = .Y! + .VY!
.Z! = .Z! + .VZ!
.RotoX! = .RotoX! + .VRotoX!
If .RotoX! < 360
.RotoX! = .RotoX! + 360
EndIf
If .RotoX! > 360
.RotoX! = .RotoX! - 360
EndIf
.RotoY! = .RotoY! + .VRotoY!
If .RotoY! < 360
.RotoY! = .RotoY! + 360
EndIf
If .RotoY! > 360
.RotoY! = .RotoY! - 360
EndIf
Ifnot @Between(.X!, -8, 8)
.VX! = -.VX!
EndIf
Ifnot @Between(.Y!, -8, 8)
.VY! = -.VY!
EndIf
Ifnot @Between(.Z!, -8, 8)
.VZ! = -.VZ!
EndIf
EndWith
EndWhile
ZeichneDoetze Doetze#[], DotzAnzahl&
WaitInput
EndWhile
KillTimer
Ogl("Done")
Dispose Doetze#[]
|
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 05/09/21 ▲ |
|
|
|