Render Script

Материал из Поле цифровой дидактики

A render script is a script that renders an image, based on a source, or a calculation based on the X position and Y position of the pixel. Render scripts are used in pen art and fractals.

Making a render script

Render scripts that fill the screen can not render the screen instantly, but they can still be used for real time fractal images if the user is skilled enough, but less experienced users can still make very complex art with it. Шаблон:Note This script will render from top to bottom:

define render
pen up
set pen size to (1)
go to x: (-240) y: (180)
repeat (360)
repeat (480)
set pen color to (Equation or Source)
pen down
pen up
change x by (1)
end
change y by (-1)
set x to (-240)
end

The variable,

(Equation or Source)

Could be any equation based on the pixel's position, or a line from a list storing data for an image. For example:

(((y position) * (((y position) + (x position)) / (x position))) * (x position))

This script will render from left to right:

define render
pen up
set pen size to (1)
go to x: (-240) y: (180)
repeat (480)
repeat (360)
set pen color to (Equation or Source)
pen down
pen up
change y by (-1)
end
change x by (1)
set y to (180)
end

Again,

(Equation or Source)

Could be any equation based on the pixel's position, or a line from a list storing data for an image.

Explanation

These scripts will render with pen, in horizontal or vertical bars at a time. The stage is 480x360 pixels, so filling 480 pixels across the x axis 360 times down the y axis will fill the stage.

(Equation or Source)

could be an equation, using

(x position)

and/or

(y position)

or a line of a list, which a variable is required.

Examples

To see some example pen render scripts, go here.