3D Object Loader

Creates an object from a wavefront OBJ File

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cwright's picture
expansion

I think this will get expanded into a more general "3d object loader" that supports lots of formats (.x, .max, .md2, etc). I'm still too inexperienced with the pros and cons of these formats to know what's appropriate to group together, and what isn't though.

smokris's picture
.max = no

Supporting .max files would be difficult:

  1. The binary format is undocumented. A few minutes of googling didn't turn up any viable reverse-engineering results.

  2. It's procedural --- so generating a mesh from a .max file would require implementing the base types and whichever procedural modifiers were used.

...and if we're going to go the procedural modeler route, I think it might be preferable to go with a more open standard, such as RenderMan (aqsis, pixie), or gSculpt or something. or CSG.

.3ds and .obj files are way easy in comparison.

cwright's picture
(consolidation)

it would be really good to consolidate all the various 3d stuff into one place on this site, rather than in several places.

Agreed, some more inspection of .max makes it non-viable.

Is renderman appropriate? In some ways, I think it's overkill for geometry+textures (and, of course, on the other hand having those kinds of capabilities would be quite rad :)

smokris's picture
(consolidation)

chris -

i grafted the "3D stuff" forum post and franz's response into this Feature Request, and named the Feature Request more generically "3D Object Loader".

steve

smokris's picture
renderman

Yeah --- renderman is overkill for just geometry and textures, and I think a good solution for that would be a good .3ds / .obj loader. But as a separate project, procedural modeling and/or CSG would indeed be quite rad.

franz's picture
got it....

i understand all the difficulties of implementing .MAX file format. However, when working with polygonized 3D (as opposed to NURBS), one will make extensive use of quads, or N-gons. When exporting to .3DS file format, the model gets chunked into triangles (or at least, triangles gets visible) which is really annoying, as the model looks tesselated. 3ds and Obj are easy because they are 15 y-old file formats.... Forget about Renderman file format, it is used for multi platform rendering, but not really suited for realtime graphics.

Anyhow, .3DS or .OBJ is still better than nothing, and is a good start. (but i don't think they include vertex weighting, so usefull when skinning a mesh for IK or skeletal animation). Maybe Gsculpt does this ? (at least it does quads, as seen in the screenshots)

dwskau's picture
Open NURBS format

The .3dm format is open and will soon be well supported on Macs by Rhinoceros (it is a popular modeler on windows and there is currently a beta out for OS X on Intel machines.) It supports NURBS and from what I can tell from Rhino, also can use polygons. It is an open source format. It might be the best NURBS format to try to implement. You can find documentation here: http://www.opennurbs.org/

cwright's picture
nurbs

This could be interesting. it'll be yet one more library to integrate into kineme 3d, but it looks like it won't be too much of a problem.

On that note, can you provide some sample objects so I can start experimenting with this format?

In related news, the FBX format (supported by kineme 3d), there's support for NURBS objects as well. currently I don't handle them, but the code to do it should be simple. I just don't have any sample objects to test with first. Some models in fbx nurbs format would be handy too, for similar reasons.

dwskau's picture
Sample objects

Right now I am on spring break and only have access to a powerpc machine so I cannot get to Rhino, but next week I should be able to make you some primitive shapes. Let me know what you want, the possibilities with NURBS are endless so I can try a bunch. I may be able to get you some .fbx files as well.

Edit: I just made a sample file of some primitives in .fbx format out of Maya. There are tons of options during export so if this version does not work for you I can try an earlier version of the format or different interpolation or any of the other options. I changed the extension to .txt to get around the attachment restrictions, just change it back to .fbx.

PreviewAttachmentSize
Samples.txt176.86 KB

franz's picture
NURBS for realtime graphics

in real time graphics, i can't really see the advantage of using NURBS geometry of regular polygons. Esp. in Rhino, which is a brilliant object-oriented (= design) modelling app, but converting a NURBS model to poly leads to glitches: holes, strange or flipped polys... So why would one need NURBS ? (and not isosurfaces or Hsplines ?)

cwright's picture
pseudo-nurbs

I don't plan on using nurbs directly, but I think it would be nice to tesselate them so they could be used. Having the formula to make them also allows for some Level-of-Detail mesh decimation.

It's quite possible to make good meshes from nurbs surfaces, you just need to be a bit careful. If the experiments fail to produce decent results, it'll be postponed or abandoned.

dwskau's picture
Meshing

Most 3d programs that handle NURBS allow you to convert the object to a mesh with fairly detailed controls. Is there an advantage to having this same functionality in QC?

cwright's picture
laziness

possibly 2 reasons I can think of.

First, laziness: you don't want to bother dealing with meshing it yourself. Or maybe you want to save disk space, or remove the possibility of having stale duplicate models ("Did I update the mesh when I tweaked the model? I can't remember!")

Second: You don't have any tools. I — this may come as a surprise — have no 3d tools on my machine. None. No 3D Studio, no rhino, no maya, no cad programs, no wings3d, no milkshape, no blender, nothing. I'm not an artist, so these tools, while really cool, provide very little value to me personally. If a model happens to be provided (like your sample one above) in NURBs only format, it's totally useless to me if kineme3d can't handle meshing it itself if it needs to.

Fear not though; This discussion is dead: it was a mere 30 lines of code to add support for meshing nurbs objects ala fbx (I'm pretty sure it won't be as nice from .3dm, but that' a bridge I'll cross when I get to it). If it's totally useless, no matter, it's already done :)

[ps: thanks for the sample! made it a breeze]

PreviewAttachmentSize
MeshedNurbs.jpg
MeshedNurbs.jpg47.04 KB

dwskau's picture
Sample

Glad to help, I'll get the .3dm to you sometime next week.

Is that what the model looked like when you imported it, or did you play with it once it was in? I did not add colors and they were not arranged in a line like that. Also the cylinder and cube seem to be split into pieces which I did not do.

PreviewAttachmentSize
Picture 1.png
Picture 1.png203.32 KB

cwright's picture
yep

I spread them out on a line to see each piece. I also added the color (I don't load colors from models). they're not transformed properly yet; I've got some kinks to work out with that still, which is why the cap and base of the cube, the base of the cone, and all the sides of the cube are split up. I've never seen a 3d tool split geometry like that before -- possibly necessary because of how nurbs works or something.

[edit: without manually translating the objects, they're all centered about the origin, which probably isn't how you had them placed.]

psonice's picture
NURBS for realtime = good :)

The one big advantage of nurbs i can think of straight off is that you effectively have a low-res mesh that generates a high-res one for output. If you can tessellate per frame, it's brilliant for doing nasty transformations with the mesh as you just animate a few hundred points instead of thousands, then tessellate.

cwright's picture
almost

Right now, I tesselate when the object is loaded. There's no convention for passing around/animating nurbs meshes in kineme 3d. While you'd save a bunch of time in mesh transformation (as you stated), you'll pick up those costs in tessellation (evaluating the surface + calculating normals), so I don't know that there'll be any gain.

perhaps I'll experiment with that sometime (I'm so backlogged on experiments anymore.. argh!)

psonice's picture
low priority anyway

I think it's probably great for certain cases - particularly where you're transforming a mesh in a way that takes much more cpu time than tessellation would. I seem to remember it being extremely good for IK animation.

I think this should be low priority though - it'd be handy later, when we have the tools to do the kind of stuff where it'd be beneficial, but the basics are more important :)

cwright's picture
3D stuff

I've been thinking about 3D stuff in Quartz lately, and one obvious patch would be an importer of sorts from various formats. There was even some recent discussion on the qc mailinglist about this functionality.

I'm not sure how much more developed it is in QCLeopard, but I think that instead of just a simple mesh importer, we might also want to make some kind of keyframe or skeletal animation patch for these 3d models.

Keyframing can be a hack using the object buffer (not yet released), but skeletal animation will require some more working.

Unfortunately, my knowledge of how people actually use and manipulate geometry for real projects is quite limited. Any thoughts or ideas on how we can develop 3D functionality in QC? smokris, is the 3D system more developed in QCLeopard?

franz's picture
functionalities

personnaly, i would love to use 3d meshes in QC, provided the tools allow this: - Modern 3D format: .X is awesome, .MAX is obvious, then of course Collada and .OBJ - Multiple tex coords - Skeletal animation - Access to vertices in a way (think sound deforming meshes)

But the most important thing to me is the fact that QC doesn't allow to handle the CAMERA -which is the most important thing to me when dealing with 3D- . At least focal lenth options.... Providing a way to load up keyframed camera data... hehe ... would allow for example pre-rendered ego-motion combination of 2D footage and 3D objects...

And more generally, 3D is uber-kewl but may also require usefull libraries, like physics for instance, that are not likely to be developped anytime soon for QC i guess ... (but i don't know what to think of Core Animation and its "behaviour based engine" ) Bouncing, damping,attraction, collision detection, spawning or gravity is the kind of stuff one would expect today when dealing with realtime 3D...

639me's picture
3D structures / camera data

have you got an idea of how to approach this yet?

gtoledo3's picture
Check out the GL Tools...

Check out the GL Tools... look at the Field of View, the Orthogonal perspective, GL Viewport, GL Matrix Mult, GL Load Matrix... and maybe even the built in Apple field of view though I don't particularly use that.

Using these with or without various blurs can make it look as though there is a "camera".

...If you mean deriving 3D structure from camera data, like turning a camera shot into a 3D object, I don't think so yet (though I swear I think this can be done... in my dreams, lol).

DanieleCiabba's picture
pixelshox

I took this idea from a plugin that work very well in "Pixelshox" by Latour, named:"Creates an object from a wavefront OBJ File". I don't know if, looking this, it will be possible to understand how it work... (i hope you understand my bad italian/english)

PreviewAttachmentSize
3dobj.jpg
3dobj.jpg15.26 KB

smokris's picture
useful

useful, thanks.

Could you upload some more screenshots of the Pixelshox object loader (there is an Inspector view, I assume?) and the downstream transformations you can perform with it?

cwright's picture
transformations

Along with that idea, how about some Maya UI shots that show how to do parameterized skeletal animation (or is this more MotionBuilder's arena?)

How about an inverse-kinematics engine?

franz's picture
FBX

For animated models, FBX file format seems the way to go, as it is a native format from most mainstream packages (MAX, Maya, MoBuilder....). I guess that even Endorphin can save FBX. An IK engine is REALLY interesting, however, it might be a huge project though.... with the need of, .... , a timeline maybe, or a system to trigger "actions" sequentially ( at which QC is really BAD actually). Why not start with something simpler, like Morph targets ?

smokris's picture
+1, Informative

Yes, FBX looks really good so far (I hadn't heard of it until now).

And Autodesk provides a free converter to handle 3ds/obj/collada/dxf, so we might even get away with only supporting FBX, since it seems to be a superset of all of those formats.

franz's picture
so far...

I was wondering if this request was still under the hood. So far, Leopard didn't provide any interesting NEW patch (apart from the GLSL grid patch) to deal with 3D. As QC DOes have a GLSL shader patch to do all sort of manipulations, i'm still very interested in having a custom 3D object loader of any kind of format (i can deal with that ...) Mesh blending via vertexbuffer is an OVERKILL bonus.

amos's picture
simple 3d object loader

I agree. It would be great to have a simple object loader.

Supporting lots of formats and animation would be cool, but let's start with something simple.

cwright's picture
pretend

I'll pretend like I'm not working on a 3DS/OBJ loader (better than qcjp's), so you'll all be surprised when it's out... ;)

yanomano's picture
3ds loader original code

The 3DS loader original code is from www.spacesimulator.net and there is a lot of interesting things about 3DS file structure.

But lets talk about an open gl patch coder before !....:)

yanomano.

franz's picture
ogl

and what's an open gl patch coder ?

cwright's picture
reference

He's referring to the JavaScript-like patch with OpenGL bindings (a future piece of GLTools, assuming we can figure out how to implement it -- it's more difficult than I first expected because of the way it was pieced together) -- this would allow you to write mock-up OpenGL code on the fly.

gtoledo3's picture
Re: reference

Whatever happened to that idea?

cwright's picture
normals

Just a quick question. If, hypothetically, we were to load an OBJ (or any format, really) without normals, should the loader fill them in automatically, calculated from the faces? Lighting doesn't work without them, and shaders may not work as well either.

If we fill them in (fairly simple, just a bit of math), should we also provide an option to smooth normals (i.e. merge normals shared at the same point) ? this is a bit trickier, but could provide for some nicer looking objects without a lot of extra effort somewhere else.

franz's picture
definetly

If no normal info is present, then i think the loader should compute them automatically, although usually normals are present in the export file. Aren't they within an OBJ ?

Smooth normals / Facet mode is also a common feature you can't ignore today, i guess

good luck

cwright's picture
OBJ's

Some of the sample obj's I've got have no normal information.

Smoothing can get pretty complex: you can merge normals at a vertex if they're within a certain Degree range to allow sharp corners and smooth parts as well. I don't Think I'll go that far just yet, but simple "average all the normals at this vertex" stuff is simple.

yanomano's picture
3D loader...

It seems that normals are easy to compute but you will have lot of problems to align them... Ex: on a cube you compute faced nomal to have them aligned but on a sphere you compute them per vertex.... By default, "smooth" vertex normals are created when an OBJ is imported. There are times when you might want hard edges or seams however (a smooth cube looks a little silly). So you might consider a parameter to adjust "angle". And not smoothing sometimes can be a good thing (see the work of xavier veillant a french artist) : http://www.veilhan.net/

You must think to an effective UVW mapping, because if normal are bad we must work without lights in the scene and bake the lights with textures before in a 3D package. With baked textures you can have really photorealistic real-time scenes (with ambiant occlusion or radiosity pre-rendered...)

Obj respect and keep quadrangle on import, 3DS import convert all with triangle so OBJ seems to be the good choice (for subdivide)

See this : http://sourceforge.net/projects/objloader

If you want i can prepare for you some simple 3D test objects in wavefront format...tell me what type you want...

yanomano.

PreviewAttachmentSize
Bordeaux_veilhan.jpg
Bordeaux_veilhan.jpg102.26 KB

yanomano's picture
no smooth !...:)

I love this one ! Veilhan monster in "Tours " france.

yanomano.

PreviewAttachmentSize
Veilhan_Monstre.jpg
Veilhan_Monstre.jpg63.96 KB

yanomano's picture
3D Bend Box

Sorry for multiple post... If you work on a 3D loader do you think we can have a 3d meshes distors patches ? ex: a bend box like this one in Maxon C4D

yanomano.

PreviewAttachmentSize
Bend.png
Bend.png67.02 KB

cwright's picture
Woah!

That's pretty slick :) umm... probably not in the first version :) It looks really useful though, so it's definitely something to keep in mind.

cwright's picture
Smoothing Optional

In the true spirit of our patches, if it's an option, there'll be an input to turn it off or configure it. We'd never force smooth normals (I argued your exact argument when forced smoothing came up earlier), it's just an option that might be desired.

The problem with the objloader library is that it's GPL, which isn't compatible with our distribution license (MIT). Our plugins get bundled with other applications, and sometimes the source is bundled in other apps as well, and GPL doesn't allow that with closed-source apps. :(

cwright's picture
fast and smooth

Ok, I've been grinding on some kineme3d stuff quite a bit lately, and I've finally managed to get fast smooth normals to work correctly, and not crash (it was more difficult than I expected to satisfy both of those criteria).

Still ironing out some redundant work that's being done, but so far it looks pretty nice. Alpha 10 should be fun ;)

PreviewAttachmentSize
FastSmoothNormalsv0.jpg
FastSmoothNormalsv0.jpg56.92 KB

toneburst's picture
Very Nice

Is that a pre-made mesh, or dynamically-generated?

alx

Quartz Composer Blog: http://machinesdontcare.wordpress.com

Music Site: http://www.toneburst.net

cwright's picture
dynamic

That's a dynamically generated plane (64x64 squares) passed through the ripple deformer driven by sound input. It's inside a Polygon Mode patch, so back faces are rendered as dots (I liked the wavy strip look). textured with the flame patch.

[previously, passing stuff through the rippler, or any deformer for that matter, would 'facetize' it because calculating smooth normals took a prohibitively long time to calculate each frame. Not so much anymore though! ;)]

[edit2: stuff in the bend box looks So Hot now... man!]

yanomano's picture
Smooth operator...:)

Hum...it smeel good christopher ;)

yanomano.

cwright's picture
Spoiler Warning

This is some Totally Experimental, unreleased, unstable, pre-beta, purely-for-amusement-purposes content:

Model and Texture provided by @franz. 3ds model, 9216 faces. non-smooth normals.

PreviewAttachmentSize
3dsLoaderKineme3DDemo.jpg
3dsLoaderKineme3DDemo.jpg81.8 KB

yanomano's picture
not bad ! :)

I can't wait to play with you ....:) what format ?

yanomano.

cwright's picture
3ds

It's a 3ds file. There's limited support for obj (3-sided faces only), and I might get around to finishing md2 eventually. 3ds gets priority, followed by obj. Then we'll see about some other formats :)

vance's picture
Love it

howdy! I might even pay for a beta...maybe a little help installing it/compiling it if necessary.

I will continue to pay for further stable versions. Quartz is a large part of my existence...

-vance feldman you know how to find me.

cwright's picture
In Alpha

Thanks for the interest :) Presently, Kineme 3D is a bit early for Beta, but I've sent you some information regarding the Alpha program if you're interested. :)

cwright's picture
Spoiler Video!

With Alpha 9 nearing completion, I've decided to lighten up the restrictions on what can be discussed with Kineme 3D.

Here's a video showing off some capabilities:

Enjoy! :)

[alpha testers, you should have it in your inbox. If not, let me know and I'll get it to you. :]

psonice's picture
Drooling!

That looks seriously good! I'm drooling with anticipation already... The 3d pixelate effect looks especially good, it reminds me of the similar effects in aura for laura (demo on ps2 - http://www.pouet.net/prod.php?which=10435)

Anyway, back to learning GLSL, and figuring out the normals.

cwright's picture
i don't know

I don't know what impresses me more: the hexagon pixelation, or the way you seem to have every demoscene effect ever memorized and at your fingertips (complete with a pouet.net link) :)

toneburst's picture
ooooh......

This looks verrrry exciting...

alx

Quartz Composer Blog: http://machinesdontcare.wordpress.com

Music Site: http://www.toneburst.net

toneburst's picture
3D Pixellate Effect

Just wondering: Is there a trick to ensure that when you 'pixellate' a 3D object, as in the spoiler (very impressive, incidentally), you get only right-angle cube forms, and no diagonally-angled faces? I'm messing around with quantizing vertex positions in GLSL, but I get lots of non-cube shapes. Quite nice and glitchy, but would be nice to get a smother effect also. Does the 3D pixellate effect only work because you have access to all the meshes vertices in OpenGL?

alx

Quartz Composer Blog: http://machinesdontcare.wordpress.com

Music Site: http://www.toneburst.net

cwright's picture
quantize

I'm not sure about how one would accomplish this in GLSL, but it's a problem in Kineme 3D's quantizer too at the moment. I've not thought about it too much, but I'm sure there's some way to get it to play nicely.

gtoledo3's picture
oh my

I just pooped myself.

cwright's picture
Transformation List

Translation and Rotation in QC may be underdeveloped: You can't apply multiple transformations sequentially (i.e. translate -5 x, rotate 32° on y axis, rotate 12° on z axis, translate +6 z, translate +5 x...) without a bunch of nested 3D Transformation patches. Maybe I'm mistaken and this can all be done with one rotation/translation step though — please let me know if I am.

If not, I think an interesting new idea might be "Transformation Lists", where you list (connect transformation patches) transformations to pass to the renderer. Then, the renderer will apply them all in order before rendering.

This would have the benefit of being fast (implemented automatically in OpenGL) and feature-complete. This seems less clunky than putting stuff in multiple nested 3D Transformation patches. There could even be a "3D Transformation List" macro patch that acts like the current 3D Transformation patch, but handles them all at once.

Thoughts?

[EDIT: yep, I'm mistaken: With rotation and translation you can give an object any orientation and location all at once. It's not always the most intuitive way to work, but it's possible]

SteveElbows's picture
Ogre 3D in QC demo

So I stumbled on this video of some Apple dev conference last year, they have demostrated the Leopard QC custom patch feature by integrating Ogre into QC!

Unfortunately it doesnt seem like they ever released that code as a sample. If anybody can implement something similar then Im up for donating $500 or so, as I could really use this sort of functionality.

Well whatever happens, I'll donate something to Kineme in February with the hope that some 3D model stuff will appear :)

Cheers

smokris's picture
"skanky sdk"

From WordNet (r) 2.0 :

  skanky
       adj : highly offensive; arousing aversion or disgust; "a
             disgusting smell"; "distasteful language"; "a loathsome
             disease"; "the idea of eating meat is repellent to me";
             "revolting food"; "a wicked stench" [syn: disgusting,
              disgustful, distasteful, foul, loathly, loathsome,
              repellent, repellant, repelling, revolting, wicked,
              yucky]

SteveElbows's picture
Well I suppose its not the

Well I suppose its not the official Apple sentiment, which I guess would be to pretend the pre-Leopard SDK never existed. Im not sure if its possible to look on the bright side and say its better to be called skanky than airbrushed out of history or called useless like the omni product he pisstook at the end.

smokris's picture
Ogre3D

We've been looking at Ogre3D, actually, for possible wrapping into QC. We were kinda thrown back by the hugeness of Ogre3D and were looking for something a bit leaner.. and our current 3d-object-loader alphas do most of what the demo showed.

SteveElbows's picture
Doesnt have to be Ogre

Well I dont mind at all what you use to achieve it, its just that video got me drooling with the possibilities, especially animation. But anything would be a nice start, is there any way to buy myself access to the alpha version? I should learn to be patient and make a nice donation, I know, but I couldnt help asking.

franz's picture
keyframes + audio

what's cool in their ogre3D demo is the keyframed animations... And the sound capabilities introduced in the magic wand demo....

vade's picture
Jitter has an Ogre3D open source port

Hi.

I am friends with the programmer who ported Ogre3D to Jitter, an alternative patching environment similar to Quartz.

The keyframe animation and blending is really incredibly useful, and should be valued.

Check the project out:

http://jitogre.org/wiki/index.php5

Thanks,

psonice's picture
Coming from a totally different direction...

... I have plans to do some 3d with QC too, but I'm planning on using realtime generated objects rather than loading up a model. The idea is to have an algorithm that generates and modifies object meshes on the fly, with the results being animated (basically, objects 'grow' in 3d, imagine plants growing and you'll have a rough idea). It'd probably be better to do this without QC, but then it has almost everything else I need for the project, and it's an idea environment for experimenting.

So far, my thinking is that I need something like this:

  • A main code loop outside QC, that creates, modifies + destroys the objects.
  • Each object is reflected in a macro patch in QC.
  • The object macro contains patches for the mesh, lighting, texturing and rendering controls.
  • 'Animator' patches that modify the mesh (perhaps with a 'tweening' patch, so that the animator patch calculates the new vertex positions, and the tween patch animates it).
  • 'Mover' patches that move objects between one point and another (for what I plan, the start point would be fixed, and the patch would move the object automatically each frame with a basic gravity and wind effect - this is easy enough, with the one catch being that i'd like some collision detection, but I'll see how it goes)
  • Modifier patches to give some control over appearance - one thing I want to do is to be able to 'age' the objects, by changing the base colour and possibly texture and mesh over time. Some wind simulation on the meshes would be good too.

So, seeing as you guys have a lot more experience with QC than I have (I've learnt the ropes, and done a few quick tests, and that's about all), how practical does that look, and what kind of problems am I likely to hit? Performance of the overall system should be fine, as I already have it so that the amount of stuff being drawn and the amount of stuff happening scales to fit the processing power available.

Also, how easy is it to link an external program in to QC so that patches can be inserted and connected by the program?

How about sound too, would it be reasonable (or wise) to add sound in (I plan to add sort-of sound effects, so when something gets triggered a sound plays (midi would probably do)).

Last thing... how necessary is it to use obj-c? My code at present is in python (this started as a terrible abuse of the procedural modelling system in houdini. :) It wouldn't be much work to rewrite it in obj-c, but brushing up my obj-c in the first place would take some time.

cwright's picture
dynamic objects

It's difficult to have a generic dynamic object (most dynamic algorithms I've seen for object creation are very specialized; they make plants, or trees, or water, or whatever, but there's a lot of customization for each one, so there's not much of a consistent interface for these...) perhaps we could make a generic "plugin-registration" patch that allows users to create their own object creation code, and have it get loaded into QC via this patch (kind of like a plugin, but in a plugin itself...).

Linking external programs to QC isn't difficult. If you embed QC in your app, you can use the provided published inputs and outputs. If you're wanting to control QC from a separate program, it's a bit more difficult, bu I've heard of a few different methods.

I've got some sound stuff in the works (don't expect anything soon though... what I want to do is process audio via nodes similar to how graphics are processed in QC. This is a pretty complex procedure, and Apple's Audio documentation is ... shall we say, lacking?). Triggering sound is really simple though; I'd be surprised if someone hasn't already made a plugin to do that.

ObjC isn't strictly necessary, as long as your application can get compiled. To interface with QC, you'll have to use objc methods though, so PyObjC might be a wise choice for you. I know exactly 0 things about Python, so I can't tell you more on that :(

Let us know how the dynamic object stuff goes. Maybe we can integrate it into our model-based 3d stuff sometime (I can see how they'd compliment each other quite well, and they'd share some similar design goals, like physics and collision detection, etc). Makes sense to put them all through the same pipe, so to speak :)

psonice's picture
Thanks for the reply. I've

Thanks for the reply.

I've a good idea of how the dynamic objects will work already (actually I've had a rough test version running via python and houdini), and what I plan should actually be quite well suited for use as a patch. As a rough idea, you have say a 'plant' patch. Initialising it would cause just a small shoot mesh to be created. You'd then have an input called 'grow', triggering it would cause a branch, or a sub-branch, or a flower to be added (depending on the current state of the plant, and with a bit of randomness thrown in). The output would be the mesh, which would either be modified over time to animate the growth, or just passed whole to an animator patch that would morph from the old mesh to the new one. (I prefer the second option, as I think it will be easier to deal with cases where a new growth trigger comes before the last one has finished growing. The plant patch just generates a new mesh with the extra branch or whatever, and the animator patch just has to morph between it's current state and the new state).

For an idea of how the animation might work (unfortunately windows only, but there's a video), check out some of the growing lines on this: http://www.pouet.net/prod.php?which=31571. I'd use similar methods, but with a totally different look.

I've had a quick look at the pyobjc bridge, and it looks workable (from what I've read, you write pure python with the exception of the methods as you said. I'll see how it goes with that initially - it'll be easier, but I guess a lot slower and with more hacks, so I might end up switching to objc.

As to sharing the code.. it depends on how it all works. I think the main bits I'll be doing won't be of much interest to anyone as it'll be very much fixed purpose (unless it'd be good as a tutorial, which I REALLY doubt if it contains any of my code :). The audio, mesh animation + texture/lighting stuff might be more useful, and I'll make those public if they can work with everyone else's stuff. Any physics/collision detection stuff will unfortunately be a really cheap + nasty hack if it gets done at all, so beyond basic gravity perhaps wind I doubt anything will be done as a patch.

I'll have to see anyway, I'm busy with a lot of other stuff so I expect this to take a long, long time! I'll let you know how it goes as I go along.

DanieleCiabba's picture
i'm excited

the growing concept its fantastic!!! for a long time I was expecting something like this

good

psonice's picture
Demoscene

There's a huge amount of stuff like that in the demoscene (if you're not aware of it, people make 'demos' - programs that do some fancy graphics with sound, in realtime, much like what we're doing with QC but people tend to make their own tools).

There's plenty of good stuff here: http://www.pouet.net/top10.php Most of it is windows only unfortunately, there are only a few for OSX (and a lot of those are ports of windows demos) but if you have windows installed there's plenty of inspiration.

I also suggest that anyone thinking of doing some 3d in QC take a look at werkkzeug (here). It's a tool for making demos (windows only unfortunately), quite similar to QC, but with very good 3d tools. It has both object loading and object generation, giving you some basic objects (cube, sphere, torus etc) and various ways to manipulate it (like extrude, translate etc.)

Some demos made with werkkzeug (best watched from the executable in windows, but there are video captures available too): The popular demo Debris (made in 177kb!) Candytron (made in 64kb!)

yanomano's picture
really interesting

Thanks for this link. This software seems to be awsome, and very well designed. Tools like extrude, 3d deformer, are the way to go....

yanomano.

cwright's picture
demoscene!

That's pretty cool! I've not seen any demoscene tools since ScreamTracker 3 in the mid nineties... It's changed so much :)

Thanks for the links. A lot of that stuff looks really powerful... I can so see this turning into a full-time job if I were to start implementing all of this stuff...... so little time...

psonice's picture
Demo tools

Werkkzeug is one of a very few demo tools that are public - unfortunately most of them are kept private, as the groups compete hard with eachother. Even with werkkzeug, the version I linked to is v1 - they're currently producing stuff with v3! Take a look at kkreiger for an idea of what they can do with the later version - it's a FPS game (windows only again), with a big map, weapons, enemies, and very detailed graphics. It's 96kb in total, including everything. It all gets generated procedurally when it loads, and they've got their own synthesisers for the music + sound.

Actually I think some of the other groups are doing more interesting demos, check out recent demos by ASD or fairlight (the city in the fairlight demo is procedurally generated - that kind of thing is well suited to QC!).

And if you hadn't noticed - it's a demo I'm working on. I wanted to do something on OSX, and QC pretty much is a demo tool (and kudos to Apple for being the first company to provide a demo tool with their OS!) It makes sense to use QC as a base, and build my own stuff around it.

gtoledo3's picture
I am particularly interested

I am particularly interested in the sound node processing...

My ideal would be an environment to write music/visual compositions... where I can organically write both at the same time. There is stuff out there, but I would really just like to be able to do what you are describing within Quartz Composer.

cat's picture
On the dynamic object front,

On the dynamic object front, I use vvvv, and dynamic objects can be made in 2 ways, 1 the is an object loader node, that can be attached to a mesh split node, which outputs a vertex buffer and an indices, you can then attach a vertex buffer node that spits out an array of vertices, normals and texture coordinates. You can then use math nodes etc to manipulate the vertices, and then put them all back together via a vertex buffer join node and mesh join, at the end of which its juts a model again. This is obviously cpu intensive! The second way is to use vertex shaders to deform a gird object of the resolution that you require, this is far faster, I'm planning on trying this second method with glsl bu tsimply havent had time, I'll keep you all inform though!

Cat

www.colour-burst.com

cwright's picture
shader method

I've already got the loader/cpu-bound deformation stuff under control (as in I understand it, not that I've implemented much ). However, I'm very interested to know how vvvv handles the shader method you mentioned. Does it abstract shaders somehow, so you can have multiple vertex shaders applied to one mesh, or is there one self-contained vertex shader only? If it's the latter, I guess I'm not that interested in it (that's what glsl can do out of the box, more or less), but the former might have some interesting design decisions that could be useful.

cat's picture
The shader method is like

The shader method is like glsl, to see how they do the cpu method, if you download vvvv, there is a folder that has so mesh distortion projects in it in the girlpower folder. THey can only support single pass shaders too...

www.colour-burst.com

Scratchpole's picture
Orthagonal vs Perspective

Great work! this obj loader may enable one of my most advanced ideas. Would it be possible to render in orthagonal view, e.g. no perspective distortion? Here's hoping. May even be able to offer some remuneration if it's possible. More info here: http://vjforums.com/showthread.php?t=23259 Cheers, Joe

cwright's picture
ortho

I've done some (unsuccessful) experiments with the glOrtho function in GLTools to try to accomplish this, but I've not had any success yet. It might be possible with the Matrix patch if you're not afraid to get your hands dirty with Matrix Math. The Projection Matrix may still break this though (the matrix patch modifies the model view matrix only).

I'll see what I can do.

[EDIT: Just to note it here: the latest GLTools beta has Ortho projection support now]

franz's picture
OrthoMatrix

I'm also interested in that function (this is my architect part...), but i don't think you can achieve ortho projection with Kineme Matrix patch. I've been buzzing a lot with Matrix patch recently, and didn't manage to get the desired effect.

yvanb's picture
yeah! Just discover this

yeah! Just discover this place. Guys you rock! i've been waiting since ages that some guys will developp a 3d object feature into QC. Thanks a lot guys!

send_two's picture
just discovered too

This is so great, just came across this project as well. Thanks to all the exciting work.

cwright's picture
hehe, thanks :)

I'm glad you two have stumbled in and decided to participate :) Just curious, how'd you find your way here?

yvanb's picture
Just diggin the web for some

Just diggin the web for some crazy guys who devellop crazy project to support them!

gtoledo3's picture
Ortho :o)

I think the high def versions look much better but...

Ortho :o)

Non ortho "remix".

cwright's picture
Havok

http://www.havok.com/content/view/582/53/

Hmm... if we can wait just a bit longer, this might make things very tasty ;)

kimba23's picture
whole new ball game

Yes! this would be so sweet!

cwright's picture
ARGH!!!

(I seem to be making a bunch of "Argh" comments lately... might as well go to windows development or something if this keeps up ;)

The free version of havok is Win-32 only. Sucks Dot Com. Anyone feel like financing a win32 dll-osx wrapper project (I've got a half-baked implementation from a proof-of-concept last fall...)? :)

cwright's picture
morg argh

to top it all off:

physx (nvidia's physics engine) is freely available to Windows and Linux users, but not osx without a $50,000 license fee.

havok is freely available to Windows users, but not osx, linux, etc without an undisclosed fee (they've stopped responding to my inquiries...)

is it time to break out an opensource physics engine, or are those vastly inferior to the above? other thoughts?

toneburst's picture
Hey cwright

what's the tune you used in that Spoiler' clip from way back in February, by the way? I semi-recognise it, but can't put my finger on that it is....

Is it a remix of a track by The Knife, by any chance?

alx

Quartz Composer Blog: http://machinesdontcare.wordpress.com

Music Site: http://www.toneburst.net

cwright's picture
remix

Yeah, it's the Trentemøller remix of We Share Our Mothers' Health, by The Knife. (I think the YouTube description has that at the bottom?). I'm surprised you could pick it out before any vocals (which would be a dead giveaway :)

toneburst's picture
ah.. thought so. There's a

ah.. thought so. There's a tiny snippet of the tracks original melody in there I picked up on. I'm quite a fan of The Knife.

alx

Quartz Composer Blog: http://machinesdontcare.wordpress.com

Music Site: http://www.toneburst.net

cwright's picture
me too

me too :) Never heard of them prior to about a year ago, but I've become quite the fan. Glad to know I'm not alone in the world :)

toneburst's picture
I only heard of them because

I only heard of them because they were the subject of much critical bandwagoning here in the UK about a year ago. The whole music journo circus has moved on now, of course (to anything that could be labelled 'dubstep', or maybe that was last month- I lose track).

alx

Quartz Composer Blog: http://machinesdontcare.wordpress.com

Music Site: http://www.toneburst.net

toneburst's picture
Binormal + Tangent Vectors

Would it be possible to have the object-loader optionally calculate Binormal and Tangent vectors for the imported geometry, and pass those to an enclosing GLSL Shader patch as vertex attributes? I ask because it makes GLSL tangent-space bumpmapping easier (possible?).

alx

Quartz Composer Blog: http://machinesdontcare.wordpress.com

Music Site: http://www.toneburst.net

cwright's picture
hmm....

binormal = tangent × Normal, so that's "not our problem" in this case ;) (provided you have the tangent vector, you can do the multiply yourself).

getting the tangent, however, is definitely something I would consider looking into. Since most shapes aren't parametric, it'd be a numerical approximation of the true tangent vector at a given vertex, which is hopefully good enough...

toneburst's picture
Cool. I've only ever seen

Cool. I've only ever seen the Tangent vectors used in bump-mapping applications, but there may be other uses too, so I reckon it would be a good thing to have. Having the option to turn it on/off would probably be good too, though. I'm sure calculating the Binormal in the VS wouldn't cause too much pain. Having said that, if you could pass that along with each vertex, it would be one less vector multiplication you'd have to do for each one...

alx

Quartz Composer Blog: http://machinesdontcare.wordpress.com

Music Site: http://www.toneburst.net

cwright's picture
trades

Good point with less work in VS-land -- I typically run into vertex attribute limits before running into VS complexity limits, so I default to calculate as much in the shader as possible if it lightens the attribute load. If there's no pressing limit though, you're totally right, and passing it along would speed up rendering a bit.

What we Really Need is a good way to handle vertex streams (so arbitrary stuff like this is simple and easy, without needing custom patches for everything...). Not sure how realistic that pipe-dream is though :)

manuelzg's picture
How do you import 3d text? OBJ

im lost, i tried in many ways to import s simple text obj model, and theres no holes in the letters, they have a cap covering all, i tried exporting from modo, an maya with no success.

any idea?

thnx

PreviewAttachmentSize
noholes.png
noholes.png109.52 KB

manuelzg's picture
Text Crashing,

well ive tried in other ways with the text model till i decided to just delete the front faces from my mesh, justo to match the movement, everything was fine and then i get this weird error, on the qtz i was working on, now i cant even move the model.

hope you can help me

thnx

PreviewAttachmentSize
weird.png
weird.png440.98 KB

cwright's picture
importation

What are you using to import the OBJ model? it looks like a bug in the obj loader.... we didn't write that, and have no interest in doing so (we have our own internal 3d plugin that handles all this stuff flawlessly... not released yet :/)

639me's picture
using GL Model Importer in vdmx

in qc, it looks good, but in vdmx, i get this, using GL Model Importer (on a geforce 8600m gt). any suggestions? are you releasing another patch soon?

PreviewAttachmentSize
Bilde 1.png
Bilde 1.png161.83 KB

gtoledo3's picture
I noticed it looked like you

I noticed it looked like you were using the "image map" glsl example.... this is a "spoiler" clip of Alpha9 with the image map glsl and some fairy dust. Quartz Crystal render.

The upload to vimeo does do something a little odd to the red in the background at times... the re-compression I guess. And it looks better in HD over at Vimeo... oh well.

It is also in tribute to Futurismo in a sense...

Kosch's picture
Is testing closed? :) I'd

Is testing closed? :) I'd like to test too.

smokris's picture
Stay Tuned...

Testing is closed for now.

Expect some news on this in the next few weeks. :^)

gtoledo3's picture
From...

From...

To....

And then...

:O)

franz's picture
I like the 1st one. How

I like the 1st one. How about the UFOs shadows projected on the railtrack ? hehe

what's your reflexion shader ? It doesn't seem to take the video into account ... or does it ?

gtoledo3's picture
On the very first one, I

On the very first one, I wasn't using the railroad as part of the image map... it would be better if I had done that. On the one with the sobel effect, and subsequently, I used the railroad as part of the image map.

If I get a second, I will go back and use the railroad as the image map and post a quick clip of the difference.

It was probably a wobble filter or the stock image map example from the developer qtz's.

Here are a couple more renders:

This one is part of an ongoing attempt I have to write a decent GLSL fur shader ... with a "head" object that I found on a website with free 3D file downloads...

This is blatantly derived from an example composition of Chris's. I wrapped it in a "wobble GLSL" shader, did a few minor tweaks, and replaced his "sphere" with the infamous teapot.

This was very "Fantasia" influenced...

Kosch's picture
ok thanks! :)

ok thanks! :)