Editing individual vertices with jit.gl.model

diatom's icon

Hello
I've got an obj file for a simple cylinder which looks like below - straightforward and simple output from blender.

What is the most memory and cycle-efficient way to edit these vertices on the fly in jitter and render the result in the jit.window? I want to use external stimuli (m4l events, controllers) to control them, such as an audio spectrum to control transformations in just specific vertices.

If it means using a different jitter module instead, then do let me know which. I want to try and retain control of the vertices, such as in a table for modulations etc.

# Blender v2.68 (sub 0) OBJ File: 'testCyl.blend'
# www.blender.org
mtllib testCyl.mtl
o Cylinder
v 0.000000 -6.000000 -3.000000
v 0.000000 6.000000 -3.000000
v 0.585271 -6.000000 -2.942356
v -0.585266 6.000000 -2.942357
usemtl None
s off
f 1 2 4 3
f 3 4 6 5
f 59 60 62 61
f 4 2 64 62 60 58 56 54 52 50 48 46 44 42 40 38 36 34 32 30 28 26 24 22 20 18 16 14 12 10 8 6
f 63 64 2 1
f 61 62 64 63
f 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63

Andro's icon

Not at home right now but off the top of my head.

Use jit.gl.model to load the model from blender.
Use the read command to load the object.
Set it's matrixoutput to 1
Now connect this to jit.matrix (specify 8 planes of float32 data, make sure adapt 1 is activated so it adapts to incoming dimensions) OR to jit.gen (this accepts all plane and dimension counts without specifying anything)
Now connect that output to jit.gl.mesh.
The whole idea here is that jit.gl.model loads it up and outputs it as a matrix, you modify the Vertices by either manipulating the jit.matrix or the jit.gen (check out the manual for GL model specifications. Example. Plane 1 is vert x position plane 2 vert y position)
You'll have to put this into a render context with jit.gl.render to see everything and such but this should be all the basic parts you need to start out.
Hope this helps !

Rob Ramirez's icon

the jit.gl.model helpfile tab labled "drawing" demonstrates the technique described by Andro above.

diatom's icon

Thanks both of you, that sorted it. This is exciting.