.obj file to jit.gl.nurbs
Sep 5, 2008 at 6:24pm
.obj file to jit.gl.nurbs
I’m working on a small set of tools to pass obj files around, operate on them, display them, etc. I’m working with a bunch of architects who work in Rhino, so we’ve been doing alot with the jit.gl.nurbs object.
Up to now, smooth sailing. I can get jit.gl.nurbs outputting obj files. But if someone hands me an obj file, I can get all the control points into jit.gl.nurbs using an edited version of what I found in this thread: http://www.cycling74.com/forums/index.php?t=msg&goto=130767&rid=0&srch=obj+nurbs#msg_130767 but they do not connect to make any surfaces – they are literally just a collection of control points in the outline of the obj.
Before I spend my time going deeper into iterating through an obj file and parsing it into a matrix to use as a ctlmatrix for jit.gl.nurbs, I thought I’d ask if anyone had any tricks up their sleeves for this kind of thing, or a list of stuff to watch out for. Or maybe admonition for this just being a silly thing to try to do, and suggestions for a better way to operate on the guts of an obj file in Max?
In a post from a while ago, JKC had this to say:
*Note that Jitter currently only supports OBJ files that are triangulated meshes. While the OBJ spec has support for NURBS surfaces and other types of parametric surfaces, you will need to force the output OBJ to be tesselated triangles for Jitter to use it.*
which I only partially understand. So. Any help is appreciated.
Sep 6, 2008 at 5:35pm
it sounds like you have a pretty good grasp of what you’re doing, do i don’t think i can offer much help.
i believe what joshua was referring to was jitter’s jit.gl.model object. this object will only load .obj files that contain mesh information, which is basically a list of triangles that creates a surface. i had no idea .obj’s even supported nurbs, but apparently they do. nurbs are not triangles, but curves.
you can parse your obj files however you want, and do whatever you want with that information. if you have a .obj that contains nurbs info, it’s up to you to translate that into a controlmatrix for gl.nurbs object. all he’s saying is you can’t use gl.model to automagically load it for you.
i’d be interested to hear what you come up with.
Sep 6, 2008 at 11:51pm
Yeah I kinda figured it out the hard way: I’m beta testing Rhino for mac and the export .obj as a tesselated mesh (instead of NURBS) function is broken – jit.gl.model gets an “out of memory” error upon trying import a NURBS .obj.
Then again being beta it could probably also be 1,000,000 other things.
I tried some stuff parsing the output of jit.gl.model’s matrix into jit.gl.nurbs but nothing seems to translate right. Even simple stuff like a 16 point square (2D, not a cube) doesn’t come out right. I thought maybe jit.op was the secret but no luck yet. I’ll keep pluggin’.
Thanks for the encouragement – I’ll show and tell when something cool happens.
Sep 8, 2008 at 5:43pm
> I tried some stuff parsing the output of jit.gl.model’s matrix into jit.gl.nurbs but nothing seems to translate right. Even simple stuff like a 16 point square (2D, not a cube) doesn’t come out right. I thought maybe jit.op was the secret but no luck yet. I’ll keep pluggin’.
completely different methods of rendering. again, gl.model is triangles, gl.nurbs is curves. if you want to do something with the matrix output of gl.model, send it to gl.mesh.
#P toggle 496 187 15 0;
Sep 10, 2008 at 5:31am
Yeah I realized very soon after I posted that was not going to work. I did some more research on the .obj spec (mesh obj and nurbs obj). I’ve learned the following:
•Iterating through an .obj file of a simple shape exported from Rhino using the NURBS spec and loading it directly into jit.gl.nurbs ctlmatrix works… but:
Which gets me to your cool, and probably very helpful, suggestion to use jit.gl.mesh, Rob – but I feel like a dolt: I can’t for the life of me get any useful matrix data out of jit.gl.mesh. I’d assumed it would be a matter of associating a named matrix with jit.gl.render, but I guess I’m wrong…?
I hate to ask for some “spell it out for me” help… but I think I’m about there. Blast.
Sep 16, 2008 at 5:30pm
Jitter and Rhino (maya, max, other)
I too am interested in communicating 3D data between jitter and rhino… both importing and exporting using nurbs, tesselated geometries, or IsoSurface. I understand basic concept of importing obj as tesselated surface to jitter.
I would like to be able to manipulate 3D coordinates (of obj, isosurface, etc) in jitter and export the data back to rhino. Do either of you have any suggestions for doing so? Successful examples or trials thus far?
Sep 21, 2008 at 9:51pm
I’ve been busy the last couple weeks on a residency, so this has kind of pushed to the back-burner for now, but in the next couple weeks I’ll be retackling this – hopefully with some fresh eyes.
Last week, I did find this though:
The toolkit which Rhino uses to read and write 3dm files is open source.
Jun 6, 2009 at 1:40am
You must be logged in to reply to this topic.