Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Plasma-effect/Ol/plasma-effect-1.ol
Normal file
14
Task/Plasma-effect/Ol/plasma-effect-1.ol
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
; creating the "plasma" image buffer
|
||||
(import (scheme inexact))
|
||||
(define plasma
|
||||
(fold append #null
|
||||
(map (lambda (y)
|
||||
(map (lambda (x)
|
||||
(let ((value (/
|
||||
(+ (sin (/ y 4))
|
||||
(sin (/ (+ x y) 8))
|
||||
(sin (/ (sqrt (+ (* x x) (* y y))) 8))
|
||||
4) 8)))
|
||||
value))
|
||||
(iota 256)))
|
||||
(iota 256))))
|
||||
25
Task/Plasma-effect/Ol/plasma-effect-2.ol
Normal file
25
Task/Plasma-effect/Ol/plasma-effect-2.ol
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
; rendering the prepared buffer (using OpenGL)
|
||||
(import (lib gl1))
|
||||
(gl:set-window-size 256 256)
|
||||
|
||||
(glBindTexture GL_TEXTURE_2D 0)
|
||||
(glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MAG_FILTER GL_LINEAR)
|
||||
(glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MIN_FILTER GL_LINEAR)
|
||||
(glTexImage2D GL_TEXTURE_2D 0 GL_LUMINANCE
|
||||
256 256
|
||||
0 GL_LUMINANCE GL_FLOAT (cons (fft* fft-float) plasma))
|
||||
|
||||
(glEnable GL_TEXTURE_2D)
|
||||
|
||||
(gl:set-renderer (lambda (_)
|
||||
(glClear GL_COLOR_BUFFER_BIT)
|
||||
(glBegin GL_QUADS)
|
||||
(glTexCoord2f 0 0)
|
||||
(glVertex2f -1 -1)
|
||||
(glTexCoord2f 0 1)
|
||||
(glVertex2f -1 1)
|
||||
(glTexCoord2f 1 1)
|
||||
(glVertex2f 1 1)
|
||||
(glTexCoord2f 1 0)
|
||||
(glVertex2f 1 -1)
|
||||
(glEnd)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue