Wiggle Draw Mesh_gt (Composition by gtoledo3)

Author: gtoledo3
License: (unknown)
Date: 2010.09.28
Compatibility: 10.6
Categories:
Required plugins:
(none)

This composition allows one to draw mesh.

Some features:

  • You can draw on mouse down/ not draw on mouse up.

  • You can change color as you draw.

  • _1024 Math and Perlin noise integration, for a fun wiggle effect.

  • Support for included mesh filters, for altering drawn mesh. This adds fun wave, bulge, noise, etc., effects.

(warning - do NOT try to introduce the Apple example mesh jiggle filter- it isn't included for a reason; the fact that mesh jiggle utilizes mouse position, and this draws, makes it work very badly together. You may get extremely bad graphics glitches, freezing and strobing of your display. Don't let this discourage you from using this composition, as posted.)

  • Ability to rotate drawn scene in space.

  • Support for changing Z, not just X/Y.

  • Support for "brute force" anti-aliasing, up to 2x.

Note: Install _1024 plugins for the "non-stock" wiggle functionality. Install _1024 plugins in your user Library/Graphics/Quartz Composer Plugins folder.

PreviewAttachmentSize
Wiggle Draw Mesh.zip66.99 KB

Comment viewing options

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

cybero's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

If you attach a randomised HSL colour output to the RII Colour input you get some really good effects, beautiful shading that you can hook up to a mouse input too.

gtoledo3's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

Yeah, I figured I would leave randomization, automation, etc., as an exercise of the reader. I was trying to make it a general purpose starting point, with a few frills.

The color queue also doesn't have to be linked to the the draw queue - it can do little color chase stuff if the queue size isn't dictated by the output of the draw queue.

leegrosbauer's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

Which location for the plugin installations? Patches or Plugins? I'm never sure in the case of third party plugins and I wasn't following closely here for a while at the point that I might have otherwise seen the installation location discussed.

gtoledo3's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

Sorry, they should go in plugins. I almost made a read-me, and then didn't. I should have.

I think pretty much anything that isn't Kineme can safely be put in plugins, with the exception of a couple Apple patches (Image Differ and iDVD), and maybe some older stuff that isn't usable anymore anyway (qc.jp.plugin, etc).

leegrosbauer's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

Much appreciated. Fun composition! Thanks!

photonal's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

wow ! excellent stuff!!

jersmi's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

Okay, George, I see a connection here -- maybe a promising solution for the "calligraphic line" idea could be to use the mesh? I'm excited about your use of the _1024 plugins, too! I'll have to play around, but here are the two things I wish from this:

  1. More control over the calligraphic mark. (For ex., yellowtail starts thin then becomes thick -- brush-like). Or here maybe develop a variety of "marks".

  2. Ability to always draw to the 2D surface (viewer), then have marks animated through 3D space.

Also, I still like Chris's manipulation of the matrix using javascript for 3D drawing, but I could see here that getting to know the mesh would be wise. Don't know enough re: use of resources, speed, stability, but maybe the best solution?

Wonderful work, as usual.

jersmi's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

Dude, I just saw those mesh filters... awesome. Thanks so much for posting these. Maybe this address a solution for developing types of marks (I realize that even saying "marks" here limits the possibilities, but I like the tactile reference)? Any practical tips, limitations, etc., for those who haven't been working with OpenCL?

jersmi's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

GT, that mesh noise filter you made is very beautiful -- like wind blowing through the space of the viewer. Makes the scale of the drawn objects seem large... so nice.

I can't see how I can get it to draw to the surface of the viewer and simultaneously be always rotating away from the current x/y mouse coordinate. maybe I'll try cwright's draw in space javascript with your mesh set up (since i have his set up to do this). i'm thinking the structures for coords will be similar...

gtoledo3's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

Take a look at the javascript in the Apple "mouse ribbon" example. There is a bit of code that makes the "tip" of a line start thin and "get bigger" as the line goes on. That principle might help you some in your quest.

The thing about Yellowtail (can't test right now), is that I seem to remember it having a very small "after draw" that thins out the line on mouse up (?). I've never given much thought to doing that.

I think that another area to look into might be to use something like a Quad, generate UV texturing coords, and then texture, to get different line looks. However, performance of that may possibly really suck.

What do you mean by cwright's manipulation of the matrix? Is it that the trackball moves around as you "write"? I can see how that adds a whacky randomness to the thing that could visually appealing. I certainly agree that as far as visual interest goes, it looks cool if the view perspective tends to look more like a camera that follows the tip of the line. I think you could take chris's javascript part that controls the rotation and use it with this, or use this and that to inform yourself to do something totally different and cooler than either.

I'm not 100% sure how mesh performs machine to machine, though I've had ok results running some complex stuff on the basic new mac mini, so I have to assume it's pretty ok in general, but maybe not with older machines.

I wasn't really posting this to say "hey, this is THE way to go", but more because it was similar to what you were discussing on the other thread, I'd already thought about posting it here, and I thought it might be interesting for you and others to check out. I've done a very similar setup that switches between quads, lines, points, triangles, mesh, 3d objects, blah blah, but it would have been harder for others to look at and "get" it easily (I'm guessing).

Sometimes I like to find many ways to do basically the same thing; most of the time they each have unique strengths, weaknesses, and usually some bells and whistles that are unique to that route.

Thanks for the compliment! I thought it "looked cool", glad you think so too.

gtoledo3's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

Hmm, my practical tip would be to be prepared that your whole computer could crash, or your display could go into some kind of crazy flashing mode if you do something with OpenCL that causes stuff to hang for some reason. So, I wouldn't be moving around files, etc., while I'm working on an OpenCL based composition and I would try to keep only that composition open, and save regularly. I ignore these suggestions all the time. I would suggest editing the kernel when running QC in 64bit mode; avoid editing in 32bit. I wouldn't ever "select all" code in an OpenCL patch, and then hit delete - this almost always makes things freak out for me.

If you work with filters, and they've "been working" and then they stop working after you cut and paste them or something; quit QC, restart, before you panic. They will likely work. Then, file a bug.

I included the filters, because I thought that they gave some interesting movement, and I'd never really seen any kind of drawing/writing program that allows one to use OpenCL filtering on what you have drawn. I think it might be a solution or partial route to some of the things you want to do movement wise, but I'm not sure.

I would look at the OpenCL ref guide, and also look at the Apple examples. That said, I don't think there is a much great material out there about proper use of OpenCL in QC, and many of the developer examples are broken as QC4 has had bugs fixed (kinda weird how that works!).

gtoledo3's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

I want to make a point of noting that the filters are essentially Apple examples that are really cool (and kudos to whoever did them). Some of them stopped working as QC4 has been updated. This_really_bothered_me, as it was one of the major "cool things" in QC4 to me. After some enquiring, I found out that some methods used didn't adhere to the standard, so I fixed the broken filters, and posted them here awhile ago.

I mentioned it above, but I'm taking a wild guess that you could use cwright's method of altering 3D rotations with the general "drawing" premise that uses the mesh (or whatever you want, really).

Total agree: when I saw the was the filters look on drawn stuff, it was an immediate "wow". I love the way the wave filter looks on stuff, and that noise too. All of them have their thing really.

jersmi's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

cwright's draw in space javascript works, but a couple problems so far:

  1. it is slow to clear / reset the mesh.

  2. the mechanism i have for drawing to the 2D screen while previous drawn parts get animated / rotated (important -- animation is simultaneous to drawing) with GL line (point, etc.) structure patch does not work with the mesh (yet). I really want this to work like I have it with Chris's js (really nice effect...) so I am still trying. Advice welcome.

and now i remember your posts with the mesh filters -- weren't on my radar cuz i wasn't using them at the time.

jersmi's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

Oh, yes, I realize this is a method that needs to be sussed, better for some situations, and that's what I am looking at -- best tool for the job.

Re: chris' js, the reason i like it is because it is not random -- I am able to create specific expressive control with real-time drawing while the line animates in 2D space, all visible in real time. Right now drawing to the 2D viewer window while what's drawn is animating is my goal. The mesh filters, possibility of lighting, etc. make the mesh desirable.

gtoledo3's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

I just checked out cwright's thing for the first time in awhile. Works beautifully insofar as allowing you to rotate a track ball, then draw "flat", then rotate again, etc.

I think what I was trying to do was to draw while I was "trackballing" which doesn't yield the results I expected when I first looked at this, long ago; it seems like rotation doesn't happen at some points that it should, but this is hard to tell for sure.

I totally see the use of this though; that can be extrapolated to a lot of scenarios, and I'm really glad you kept mentioning it; it's a killer tidbit from cwright, as usual.

I've done a lot of drawing stuff, and I always come to this crossroads of "do I want to make one thing that does everything, or one thing that does something really specific." I'm still not 100% sure where you want to go with some of your concepts other than that you like an organic feel - and who doesn't ;-) ?

One thing I saw that was actually called "draw in space" (I think?) and is a pretty old processing sketch would be at something like z=0, and you can draw, and then after so much amount of time, z starts exponentially decreasing to something like z=-20, all the while x/y coords are "scaled" so that they still follow the cursor perfectly. So you do this kind of zoom in/zoom out every 10 seconds while drawing, and then there are straggling line parts "between" the two drawing areas.

Maybe a "cool" riff off of that concept would be to "zoom" to more than two places.... maybe a dozen or so, and have the "engine" of the qtz keep pushing drawing area to those little areas of concentration. I wish I could have found the processing sketch I'm talking about to link to and show you. I'll keep an eye out and link to it if I find it.

It will be very "hot" when/if _1024 particle warfare starts working with Z. I have so many things along these lines that I'm just dying to render with particles and add that nice perlin noise to, but in 3 dimensions. Texturing of the particles would be pretty essential too. At that point, it lops off a big chunk off of the couple cool looking visual things that are easier to do in processing than QC.

(I love processing but I wonder when people will realize that those sketches are so fast because they are embarrassingly small pixel counts much of the time, and that the real cool stuff is still done offline).

gtoledo3's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

Damn, I am soooo slow. I just realized that the inverse rotation patch allows you to record trackball with value historian essentially. I remember a discussion about trackball possibly being able to be "grabbed" and recorded with VH, but I never put one and one together until this very moment. Kudos to cwright for a "new" function I didn't realize was possible!!!

jersmi's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

That's cool, too...

jersmi's picture
Re: Wiggle Draw Mesh_gt (Composition by gtoledo3)

Thanks so much for relating your experiences.