Height & Width in QC

ChazUK's picture

Hi,

I'm pretty much completely new to Quartz Composer, and I'm trying to make some simple graphics as like an introduction video, kind of like the Timeline example included.

So my question is, is there anyway I can specify a specific width or height / x or y position, even if the viewer is stretched or shrunk.

I've been trying to find something about how the measurements work in Quartz but I haven't found anything of real use.

Thanks, Charlie

ChazUK's picture
Re: Height & Width in QC

Oops!

I should have also asked if there is a definitive Quartz Composer Help and Support forum as I know this is mainly to do with the plugins that you guys at Kineme create.

Thanks, Charlie

.lov.'s picture
Re: Height & Width in QC

Width and height in QC is not in pixels, this are Quartz Composer Units. If you using Rendering Destination Dimensions patch, this patch will let you know the current width/height in QC Units and in pixels - rendering destination dimension means the size of the rendering window.

For calculations: Unit = Pixels*2/RenderingDestinationDimensions_PixelsWide

For example when your rendering window's size is 640x480: Width = 6402/640 Height = 4802/640

This means the width will be always 2 :)

Hope this helps a bit.

.lov.'s picture
Re: Height & Width in QC

As i remember there is in-app help (not sure, never used). The guys here are really helpful too.

And here is some links: http://developer.apple.com/graphicsimaging/quartz/quartzcomposer.html http://en.wikipedia.org/wiki/Quartz_Composer

Finally, the QC dev list: http://lists.apple.com/mailman/listinfo/quartzcomposer-dev

itsthejayj's picture
Re: Height & Width in QC

The 'Image Dimensions' patch is your friend in this situation, if the math is a head ache for you at the moment.

See attached

PreviewAttachmentSize
Image Dimensions.qtz707.68 KB

ChazUK's picture
Re: Height & Width in QC

Thanks for the links, they are definitely going in my bookmarks!

ChazUK's picture
Re: Height & Width in QC

Thanks for the equation. I did notice how the default setup was from -1 to 1.

And thanks for the Image Dimensions hint!

ChazUK's picture
Re: Height & Width in QC

I just had a play with the Image Dimensions patch, but can this technique also be used with X and Y positioning?

Thanks, Charlie

gtoledo3's picture
Re: Height & Width in QC

Assuming you aren't talking about the built in X/Y (nothing is keeping you from using that), I guess you may wish to look at the anchor position patch. Feed it with the width and height from Image Dimensions.

jersmi's picture
Re: Height & Width in QC

I am sympathetic to your post. Understanding pixels vs. units, cropping, resizing, transforming, resolution, etc., then using them in practice, troubleshooting, etc., takes a bit to get used to in QC.

A suggestion in response to your specific question -- you could load a Sprite, then alter the width, height and x/y position. (Could also use a Billboard and change to Custom Size under Settings).

It was helpful to me to have a look at the comp Image Resizer.qtz, which can be loaded from the Library window, but to look at the innards of the patch, find it in System/Library/Compositions.

edit: imho, this site in combo with the apple quartzcomposer-dev mailing list are the best / most active places to get help.

ChazUK's picture
Re: Height & Width in QC

I did have a look at some of the examples, but couldn't really figure out how some of them worked.

I will look into the Image Resizer example.

Just signed up to the mailing list as well! Thanks