|  |  | 
|  | 
|  | 
|  p.specht
 
 
  | | avec qui  r -bouton peux qui direction modifié volonté... 
 Titre de la fenêtre "Punktwolke"
Fenêtre Style 24
randomize:Fenêtre 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' um z-Achse
var v!=-0.6*pi()/180' um x-Achse
var u!=0.4*pi()/180' um y-Achse
'Random-Punkte
px![]=rnd(2*xx&)-xx&
py![]=rnd(2*xx&)-xx&
pz![]=rnd(2*xx&)-xx&
'Zeichne
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&=&Boucle
        si Pz![i&]>0' seulement qui "hinter" dem Schirm
            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
    si w!<>0
        cw!=cos(w!):sw!=sin(w!)
        whileloop 0,&n:i&=&Boucle
            tmp!=px![i&]*cw!+py![i&]*sw!
            py![i&]=py![i&]*cw!-px![i&]*sw!
            px![i&]=tmp!
        endwhile
    endif
    si v!<>0
        cv!=cos(v!):sv!=sin(v!)
        whileloop 0,&n:i&=&Boucle
            tmp!=py![i&]*cv!+pz![i&]*sv!
            pz![i&]=pz![i&]*cv!-py![i&]*sv!
            py![i&]=tmp!
        endwhile
    endif
    si u!<>0
        cu!=cos(u!):su!=sin(u!)
        whileloop 0,&n:i&=&Boucle
            tmp!=px![i&]*cu!+pz![i&]*su!
            pz![i&]=pz![i&]*cu!-px![i&]*su!
            px![i&]=tmp!
        endwhile
    endif
    waitinput 21
    cas %clé=114:w!=-w!
until %clé=27
end
 | 
 | 
|  | 
|  | | Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 11.05.2021  ▲ | 
 | 
|  | 
| 
 
 
 |