Handy functions to make your life easier...
Returns time-number
Returns the number of seconds (+ fraction) since midnight January 1st 1970. This is the simpest animation source for your scripts.
Example
(define (animate) (rotate (vector (sin (time)) 0 0)) (draw-cube)) (every-frame (animate))
Returns time-number
Time in seconds since the last frame. Used to make animation frame rate independant.
Example
(define (animate) (rotate (vector (* (delta) 10) 0 0)) (draw-cube)) (every-frame (animate))
Returns random-number
Returns a random number between 0 and 1.
Example
(define (animate) (colour (vector (flxrnd) (flxrnd) (flxrnd))) (draw-cube)) (every-frame (animate))
Returns void
Seeds the random number generator so we can get the same sequence.
Example
(define (animate) (colour (vector (flxrnd) (flxrnd) (flxrnd))) (draw-cube)) (flxseed 10) (every-frame (animate)) ; the same sequence of colours will be generated
Returns void
Sets a list of search path strings to use for looking for fluxus related files, such as textures, shaders etc. Paths will be searched in order each time, and need trailing slashes.
Example
(set-searchpaths (append (get-searchpaths) (list "/path/to/my/textures/" "/path/to/my/other/textures/")))
Returns void
Gets the list of search path strings to use for looking for fluxus related files, such as textures, shaders etc. Paths will be searched in order each time.
Example
(display (get-searchpaths))(newline)
Returns fullpath-string
Searches the search paths for the specified file and returns the first location it finds.
Example
(fullpath "myfile")
Returns void
Saves out the current OpenGL front buffer to disk. Reads the filename extension to decide on the format used for saving, "tif", "jpg" or "ppm" are supported. This is the low level form of the frame dumping, use start-framedump and end-framedump instead.
Example
(framedump "picture.jpg")
Returns void
For rendering images that are bigger than the screen, for printing or other similar stuff. This command uses a tiled rendering method to render bits of the image and splice them together into the image to save. Reads the filename extension to decide on the format used for saving, "tif", "jpg" or "ppm" are supported.
Example
(tiled-framedump "picture.jpg" 3000 2000)