Jit.gl.mesh and gridshape question

Scott.Houston's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Hi Guys
I Currently have a jit.gl.gridshape object going into a jit.gl.mesh object. When you have it on points drawing mode you can see the individual points that it uses to make a sphere. I was wondering whether it is possible to get that list of data from the gridshape object so you can control or move each individual point to make a different shape?

Thanks a lot

dtr's icon

use the @matrixoutput attribute to get its vertex and other data as a matrix

Scott.Houston's icon

I have the @matrixoutput as 1 and i send it to the matrix but how could i retrieve each individual points information so i can move them individually? or am i not understanding your reply?
sorry im quite new to jitter so i dont understand all a too much yet.

dtr's icon

Each cell of the matrix holds the data for one vertex so you can modify it with matrix or getcell/setcell operations. You have to get the planes right. If I remember correctly the first 3 planes are XYZ position.

Scott.Houston's icon

ok ive checked the planes and all that are correct by using the jit.fpsgui on the gridshape and then copying that data onto the matrix and i have the matrix going into the mesh and it all seems to be working perfectly.
But i cant seem to edit the shape still or move the points? ive used the setcell and get cell similar to what they do in the help file for the matrix but still nothing? am i doing something wrong or is there something else i can do?
im attempting to do something similar with the jitter recipes 31 https://cycling74.com/tutorials/jitter-recipes-book-3/ but instead of that have a sphere as the the starting shape.
thanks a lot for you help by the way :)

dtr's icon

> am i doing something wrong or is there something else i can do?

Surely but hard to say without seeing your patch... See https://cycling74.com/forums/welcome-to-the-cycling-74-forums-take-a-moment-to-read-these-instructions about posting patches on the forum.

Scott.Houston's icon
Max Patch
Copy patch and select New From Clipboard in Max.

oh yer sorry heres a condensed version of what i was doing

Rob Ramirez's icon

you need to disable automatic mode on the gl.gridshape (@automatic 0). you only want to send the matrix of vertices one time, to set the initial positions of the matrix. after that you can adjust the positions manually.

your pack object should be taking floats as vals, not integers.

Max Patch
Copy patch and select New From Clipboard in Max.

after setting the cell, you also need to bang the matrix to output the modified matrix. trigger can accomplish this.

dtr's icon
Max Patch
Copy patch and select New From Clipboard in Max.

What you did is correct but you ain't getting any visible result because the matrixoutput of gridshape instantly overwrites your manual settings. Here's a modified patch. First fire it up as you did, then disable the gate between gridshape and mesh, and set manual vertex positions. The other thing you forgot is to bang the edited matrix so it gets sent to mesh. I edited a couple more little things which I'll let you discover by yourself.

dtr's icon
Max Patch
Copy patch and select New From Clipboard in Max.

While we're at it, here's a variation that should give you some ideas about how to go about this kind of thing:

Scott.Houston's icon

thank you so much they both help a lot it'll really make my patch a lot better :)

dtr's icon

wow! did parallel universes collide here? i swear there was no post by robert when i posted my replies :]