atomare Spaltung... (3D) von ???
[code:1:8c956dd30b]
Graphics3D 800,600,32,2
SetBuffer BackBuffer()

SeedRnd(MilliSecs())

;---

piv = CreatePivot()

pivBLITZ = CreatePivot()

cam = CreateCamera(piv)

light = CreateLight(1,cam)
LightColor light,255,255,255

MoveEntity cam,0,0,-60

;---

timer = CreateTimer(30)

;---

Type obj

Field test

Field xr#
Field yr#

Field d#

Field r
Field g
Field b

End Type

Global o.obj

;---

Type objb

Field test

End Type

Global ob.objb

;---

piece = 50

createOBJ(piece)

;---

While Not (KeyHit(1) Or KeyHit(57))

If KeyDown(200) Then TurnEntity piv, 1, 0, 0
If KeyDown(208) Then TurnEntity piv, -1, 0, 0
If KeyDown(203) Then TurnEntity piv, 0,-1, 0
If KeyDown(205) Then TurnEntity piv, 0, 1, 0
If KeyDown(201) Then MoveEntity cam, 0, 0, 1
If KeyDown(209) Then MoveEntity cam, 0, 0,-1


WaitTimer(timer)

UpdateWorld()
RenderWorld()
Flip()

Wend

End

;---

Function createOBJ(piece)

min = 20
max = 40


For i=1 To piece

o = New obj

oxr = Rand(0,359)
oyr = Rand(0,359)

od = Rand(min,max)

o
= Rnd(100,255)
og = Rnd(100,255)
o = Rnd(100,255)

o est = CreateSphere()
EntityColor o est, o
, og, o
RotateEntity o est, oxr, oyr, 0
MoveEntity o est, 0,0, od

createBLITZ(o est)

Next

End Function

;---

Function createBLITZ(obj)

xo# = EntityX#(obj)
yo# = EntityY#(obj)
zo# = EntityZ#(obj)

stepping = 20

;---

xstep# = xo / stepping
ystep# = yo / stepping
zstep# = zo / stepping

xp# = 0
yp# = 0
zp# = 0

For i=0 To stepping-1

xi# = xp + xstep*i ; + Rnd(-10,10)
yi# = yp + ystep*i ; + Rnd(-10,10)
zi# = zp + zstep*i ; + Rnd(-10,10)

ob = New objb
ob est = CreateSphere()
PositionEntity ob est, xi, yi, zi
ScaleEntity ob est,0.2,0.2,0.2

Next

End Function
[/code:1:8c956dd30b]



Suche:
(unterstützt mySQL Wildcards ala %)
Titel:
Text:
Autor: