move an object along the coordinates from an .obj imported line/path

Dec 27, 2010 at 9:50pm

move an object along the coordinates from an .obj imported line/path

I have searched the forum and read a lot of interesting solutions but still getting nowhere.

So, here i am with a question.

What i want:
# Get in Jitter OpenGL all the coordinates from an imported .obj vector line/path (not straight).
# And then move an object along this imported .obj (not straight) vector line/path from one end point to the other and back with different speed.

How it have to be:
# Lightweight and fast: because their will be +-120 vector lines/paths.
# Smooth and exact movement.

What i need:
# Help :)
# Interesting solutions, ideas to look at
# Starting points
# Example patches to test, …

Thanks

#53973
Dec 30, 2010 at 3:46pm

No way for me to test this at the moment, but I would start by opening the .obj with jit.gl.model @matrixoutput 1 and dump that in a matrix @thru 0.
This will store the coordinates of all the vertices of the object (your ‘path’) in the matrix, without outputting anything. You can then go throught the cells of the matrix one by one, with ‘getcell’ for instance, using the resulting x,y,z values as the position of the object you wish to have following the path.

#194218
Dec 30, 2010 at 3:53pm

Wow, i will try this out now.
I keep you informed.
When you have time and want to try this out, let me know.
Thanks.

#194219
Dec 30, 2010 at 5:16pm

That sounds really cool, hope you get it working.

The matrix idea is best. Though you can check out the .obj file with a text editor, you’ll see that any line that looks like this

v 10 5 20.5

is a vertex. So [text] and [route v] should give you vertices too, probably this is similar to what jit.gl.model does to output the matrix. If you use the text way, only have one group in the .obj file, for clarity…

…there are other elements too, like “f”, which defines the polygon’s faces. maybe you can do something fun with those too :)

http://en.wikipedia.org/wiki/Obj

the .obj syntax is very clean and easy to follow, so [text] and [route] on each line of text could really be useful to parse things out.

#194220
Dec 30, 2010 at 9:57pm

Thanks for the interesting replies.

Right now i have find a little bit the time to check the [jit.matrix] solution, …, a small exercise to get the muscles warmed up.

– Pasted Max Patch, click to expand. –

enjoy, here the night starts, i am back tomorrow

#194221
Aug 13, 2013 at 7:42am

It just occurred to me that it might be possible to use Iannix in coordination with Jitter for a similar purpose..

#258767
Feb 27, 2014 at 5:09am

Hi bitter I suggest to investigate the jit.path object instead use the getcell message.

#282306
Feb 28, 2014 at 1:32am

Hello. Amazing how an old post comes alive again.

In the time that i have post this, there was no [jit.path] object, but if [jit.path] does the job then you have pushed the button to restart that project. :)

I have stopped that project because the matrix (getcell) solution was way to slow.
The other reason why i have stopped with that project is that most of the .obj files are not recognised by [jit.gl.model]. I have banged my head to get all .obj files working.
Is [jit.gl.model] now working with all kind of .obj files or is it still a pain in the … ?

When i find free time i will test the [jit.path] solution.

@HTHAW: “Iannix in coordination with Jitter” seams ok, but i like to keep it “clean”, one software per project if possible. That’s very convenient when inexperienced people have to start up a project. :)

Thanks!

#282426

You must be logged in to reply to this topic.