| |
|
|
p.specht
| with the r -Button can The direction changed go...
Window Title "Punktwolke"
Window Style 24
randomize:Window 0,0-%maxx,%maxy
var xx&=width(%hwnd):var yy&=height(%hwnd):var xh&=xx&\2:var yh&=yy&\2
def &n 500
declare px![&n],py![&n],pz![&n],i&,cw!,sw!,tmp!,cv!,sv!,cu!,su!
'Drehachse (Kardanwinkel):
var w!=1*pi()/180' circa z-axis
var v!=-0.6*pi()/180' circa x-axis
var u!=0.4*pi()/180' circa y-axis
'Random-spots
px![]=rnd(2*xx&)-xx&
py![]=rnd(2*xx&)-xx&
pz![]=rnd(2*xx&)-xx&
'draw
MCLs xx&,yy&,0
Repeat
startpaint -1
cls 0
'cls 0
'usepen 0,1,0:line 0,yh& - 2*xh&,yh& : line xh&,0 -xh&,2*yh&
whileloop 0,&n:i&=&Loop
if Pz![i&]>0' only The "hinter" the screen
usepen 0,2+xh&/(1+pz![i&]/8),rgb(pz![i&],0,0)
line xh&+px![i&],(yh&-py![i&]) - xh&+px![i&]-1,yh&-py![i&]
endif
endwhile
endpaint
MCopyBMP 0,0-xx&,yy&>0,0;0
if w!<>0
cw!=cos(w!):sw!=sin(w!)
whileloop 0,&n:i&=&Loop
tmp!=px![i&]*cw!+py![i&]*sw!
py![i&]=py![i&]*cw!-px![i&]*sw!
px![i&]=tmp!
endwhile
endif
if v!<>0
cv!=cos(v!):sv!=sin(v!)
whileloop 0,&n:i&=&Loop
tmp!=py![i&]*cv!+pz![i&]*sv!
pz![i&]=pz![i&]*cv!-py![i&]*sv!
py![i&]=tmp!
endwhile
endif
if u!<>0
cu!=cos(u!):su!=sin(u!)
whileloop 0,&n:i&=&Loop
tmp!=px![i&]*cu!+pz![i&]*su!
pz![i&]=pz![i&]*cu!-px![i&]*su!
px![i&]=tmp!
endwhile
endif
waitinput 21
case %key=114:w!=-w!
until %key=27
end
|
|
|
| Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 05/11/21 ▲ |
|
|
|