Hi list!

I collected this script from one composition example, this script reads an
array/structure and adds  '.1' to the next element but only in Y.
To make it in both X and Y I guess I need to add some cos() and sin() but
how can I get the angle?
I attached a com example as well to see the effect.


var _Vertices = []
var _Colors = []

function (__structure Vertices, __structure Colors) main (__structure
Positions)
{
    var result = new Object()
    var thickness = .1

    if (Positions != null) {
        var v = 0
        var c = 0
        for (var i=0; i < Positions.length; ++i) {
            var pos = i/Positions.length
        //    var angle = Positions[i][0]-Positions[i-1.][0]

            _Vertices[v++] = [ Positions[i][0],
Positions[i][1]+thickness*(1-pos), 0.0 ];
            _Vertices[v++] = [ Positions[i][0],
Positions[i][1]-thickness*(1-pos), 0.0 ];

            var color = [pos, pos, .5, 1.0]
            _Colors[c++] = color
            _Colors[c++] = color
        }
    }

    result.Vertices = _Vertices
    result.Colors = _Colors
    return result
}


thank you list!

Attachment: Mouse Ribbon Y wide.qtz
Description: Binary data

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to