jit.gl.render.grid to jit.phys.body

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

hi! i want to extrude the binary video for using it with phys objects. can you help me with deleting the rest of unused plane, and put matrixoutput to jit.phys.body?
big thanks to everyone!

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

i cant edit my post :)
i v made litle step, but now i cannot get the matrixoutput from jit.gl.mesh.

ćwiek's icon

help help @:)

Rob Ramirez's icon

hi napentro.

i'm a little unclear on what you are trying to accomplish.
if you set jit.phys.body @shape concave @mass 0, you can send your geometry matrix directly in to the phys.body.

you don't need a matrixoutput of gl.mesh (and gl.mesh does not support matrixoutput) just send the same matrix you are sending to gl.mesh, to phys.body.

hope that helps.

ćwiek's icon

:) thanks for answer!

so maybe i will start from the begin. i would like to use binary image from webcam, to controll the phys object. i would like to do something like this http://www.youtube.com/watch?v=f_u3sSffS78.

unfortunately when i try to send the matrix to jit.phys, like in tutorial with matrix, thinks dont work as they should. i v got problems with the position rotation and scale of extruded shape in 3d, and everything is terribly slow. :(

ćwiek's icon

help help @:))

Rob Ramirez's icon

please post your patch showing how you are sending image data to the physics object.

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

thank you!

Rob Ramirez's icon

any reason your not just using a jit.phys.body @shape cylinder and jit.phys.body?

other than that, your patch seems to be behaving as expected, so i'm not entirely sure what you need help with.

if it's a fps issue, disable the phys.gl.draw and decrease the dimensions of your input matrices.

for what it's worth, a future release will introduce a new physics object specifically designed to handle streaming matrices. but for now, a jit.phys.body @shape concave is the way to go.

MuShoo's icon

I... think? I can't really tell, I'm having issues understanding Napentro - but I think i'm having a similar problem.

Whenever I pass my geometry matrix into a jit.phys.body, and it's set to either @shape concave or @shape convex, rotation and position totally die - the object resets itself to 0. If I disconnect the geometry matrix for jit.phys.body, rotation comes back online, but position acts... strangely - I can move it around with jit.phys.picker, but it doesn't have any inertia. It seems to be affected by outside forces (a jit.phys.ghost with a negative central force will pull it towards the center, but veeeeeery slowly compared to a simple phys object).

Anyway, I don't know if this is all the way it's 'supposed' to work, there's not that much information that I can find about the convexhull/concave setting in the literature or on the forums. Am I supposed to also be putting in a position matrix, somehow? That's sort of what I want to use jit.phys.body for in the first place, so that strikes me as odd.

My patch is a bit too big (and currently disorganized) to post, sadly. Hopefully what I typed above made sense - it's 7am and I haven't slept.

MuShoo's icon

OK so it would appear that regularly updating the vertex matrix also forces the jit.phys.body object to reset completely, hence all my issues. Which is sad, I wanted to change the shape of it on-the-fly, not just at first load! (I was toying with an example someone posted on another thread).

Any reason that feeding jit.phys.body a constantly-updating matrix of vertex points isn't an available thing? I suppose if a vertex suddenly moves from within world bounds to out-of-bounds it could cause some mathy-crashy issues? Anyway if anyone has some insight I'm interested to know. For now I guess I'll use spheres.

MuShoo's icon

Slightly spammy - but another fun thing. Setting a jit.phys.body to convexhull, feeding it a matrix, then changing it back to sphere, makes the physics system act all strange until I quit max and relaunch. It's like all my physics objects are moving in jello.

MRTN's icon

any update on this project? i'm having some issues as well in finding a way to have a webcam input and use it as collider body

matmat's icon

hi, this can be a good starting point : https://cycling74.com/forums/cameratophysic2d

MRTN's icon

i found it yesterday in my research, but as i'm going to use multiple 3d cubes, i have huge problems in having the multiple reacting with my shape (while the poly int he patch reacts amazingly good)...