XML Feeds

.

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

Wesley Smith wesley.hoke at gmail.com
Sat Dec 29 23:21:10 MST 2007


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
>


More information about the javascript-dev mailing list