XML Feeds

.

[javascript-dev] How to get matrixoutput from jit.gl.gridshape

Joshua Kit Clayton jkc at musork.com
Sun Dec 30 01:10:49 MST 2007


I think if you use JitterListener with a jit.gl object with  
@matrixoutput 1 you can get access to the matrix output in javascript.  
Should work but long time since I tested this.

Let us know if it doesn't work.

-Joshua



On Dec 29, 2007, at 10:21 PM, "Wesley Smith" <wesley.hoke at gmail.com>  
wrote:

> I don't think you can grab the matrixoutput in JS since that is part
> of the maxwrapper which JS has no access to.  JS Jitter objects simply
> reference the bare Jitter object (this will make more sense if you
> have ever done any Jitter C dev or have read related docs.  It might
> even be mentioned in the JSJitter docs).  Anyway, there have been
> threads on this topic before and I believe the conclusion was it's
> simply not possible due to the lack of outlet knowledge in JS.
>
> As an alternative, gridshapes can be easily built with jit.expr
> expressions.  In fact the name jit.gl.gridshape comes from the mapping
> of the vertex data to a grid aka a matrix and the simple expressions
> used to generate the corresponding geometry.
>
> best,
> wes
>
> On Dec 30, 2007 12:14 AM, Jack Phillips <jackwphillips at gmail.com>  
> wrote:
>> Hi list,
>>
>> I'm currently trying to get the hang of javascript with jitter, but
>> I've hit a bit of a snag.  I'm trying to recreate Andrew's Jitter
>> Recipe 12: Texture Distortion in js.  I need to be able to grab the
>> output matrix of a jit.gl.gridshape object in matrixoutput mode.  1)
>> How do I do this? and 2) Is it necessary to declare a render
>> destination if the gridshape is only used in matrixoutput mode?
>>
>> Here's the relevant code:
>>
>> var  myShape = new JitterObject("jit.gl.gridshape");  //Render
>> destination necessary?
>>        myShape.shape = "plane";
>>        myShape.dim = [2, 2];
>>        myShape.matrixoutput = 1;
>> var shapeMatrix = new JitterMatrix(3, "float32", 2, 2);
>>
>> function bang() {
>>        myShape.matrixcalc(shapeMatrix, shapeMatrix) //What's the  
>> right
>> method call?
>>        outlet(0, "jit_matrix", shapeMatrix.name);
>> }
>>
>> Thanks for any insights.
>>
>> _______________________________________________
>> javascript-dev mailing list
>> javascript-dev at cycling74.com
>> http://www.cycling74.com/mailman/listinfo/javascript-dev
>>
> _______________________________________________
> javascript-dev mailing list
> javascript-dev at cycling74.com
> http://www.cycling74.com/mailman/listinfo/javascript-dev


More information about the javascript-dev mailing list