Hi,
If you go through the lessons and examples that come with CFDG you will be able get an idea of how to make it do a range of cool things.
below are some commands that I gleaned from the examples mentioned above.
I am assuming you understand about starting off with a "startshape" and you know about writing simple rules.
Shape Commands
CIRCLE{} - draws a circle
SQUARE{} - draws a square
TRIANGLE{} - draws a triangle
*note that you must use CAPS when typing in CIRCLE, SQUARE and TRIANGLE
Manipulating Shapes
CIRCLE{
x 1} - the 'x 1' says to shift the circle one to the right (use -1 to go left)
CIRCLE {
y 1} - the 'y 1' says shift the circle one up (-ve goes down)
* if you don't leave a space between the 'x' or 'y' and the number, you will get an error and the thing won't draw.
CIRCLE{
skew 15 15} - This pushes a shape parallel to the x axis, y axis or both. You need to specify two numbers after the "skew" command, one for x and one for y. If you only want to skew it along the x axis, you would say CIRCLE{skew 3 0}
TRIANGLE{
flip 180} - This reflects the image across a line at the given angle (180 degrees in my example above). If you do this to the preceding example, you will end up with a six sided star.
TRIANGLE{
r 30} - This rotates the shape by the number of degrees specified.
Coloring Commands
CFDG uses HSB for color.
The 'H' stands for hue and can take values from 0 - 255
hue 0 = red
hue 30 = orange
hue 60 = yellow
and so on. You need to experiment to find the shade you want
The 'S' stands for saturation. s 1 will give you full colour, s 0.3 will look very washed out. Again, experiment and see what works
'B' stands for brightness. A brightness of 0 gives black, a brighness of 1 is white. Values in between will be various shades of grey.
Below are some examples
CIRCLE{hue 0 sat 1 b 1} - Red Circle
CIRCLE{hue 0
sat .1 b 1} - Pale Pink Circle
CIRCLE{hue 0 sat 1
b .5} - Dark Red Circle
Other Useful Stuff
If you have a really cool shape that you want to use in a design but don't want to put in all the code, you can use an
include. This then lets you use rules specified in a separate cdfg file.
This is often how people will include letters or special shapes in their work.
eg:
Code: Select all
startshape ripples
include dot_ripple.cfdg
This lets me use the ripples generated in dot_ripple.cfdg in a new design called "ripples".
Finally, if you want to change the background colour of your image, you can do so by using code as follows:
Code: Select all
startshape ripples
[b]background[/b]{hue 60 sat .2 b 1}
If you want a black background, you would need to say
background{b -1}
For more hints and tips, you really need to go through the examples / lessons that come with cfdg.
If anyone out there sees any mistakes / errors / ommisions in the above, please say something!
G-d Bless
Dzeni