Pixels Vs. Vectors |
Print Previous Next |
Introduction For some effects, like the random SCE Color Fill, the matrix size does not matter. The matrix will be filled up with pixels, whatever the size of the matrix is. But what about an effect that draws vertical lines onto the matrix from top to bottom. It is easily possible to write such an effect for a well-known matrix size. The disadvantage is that if the size of the matrix changes or if someone else wants to use the script, it has to be changed to fit the new matrix size. Or you could be aware of the matrix size and calculate the number of pixels for the line to be drawn. To have an easier way to create effects that are scalable, MADRIX Script provides two versions for the majority of render functions. One returns exactly the pixel coordinates as parameters and the other gets relative coordinates between 0.0 and 1.0.
Rules Of Calling Functions Overview The name of a draw or render function always starts with a description of what it does, like Draw or Fill. It is followed by Pixel or Vector to describe whether the function gets pixel coordinates or relative coordinates. The final part describes the application of the function, like Rect or Line. Here are some examples:
Using Absolute Coordinates Functions with Pixel in their name operate on absolute pixel values. Picture a rectangle which is drawn from x=5, y=5 with a size of 10. The object will always be rendered starting from 5, 5 to 15, 15, on each matrix. On the one hand, the rectangle appears to be very small on larger matrices. On the other hand, it seems to be bigger on small matrices because it fills a larger area of the matrix.
Using Relative Coordinates Functions with Vector in their name operate on relative values. 0, 0 stands for the upper left corner of the effects matrix. 1.0 describes its lower right corner, or its whole length and height. A rectangle which is drawn from 0.25 with a size of 0.5 will look the same on every matrix. Its size is simply the half of the matrix size. On a matrix with more pixels the rectangle is also drawn with more pixels compared to fewer pixels on a smaller matrix. Whereas the usage of absolute coordinates dictates the utilization of the same amount of pixels.
|