Sprite which always faces viewer?

lifemusic's picture

Is there a patch that is movable in three dimensions like a sprite, but which always faces the viewer like a billboard?

I've searched through Kineme's forums, and also Apple's QC Developer's forum without much success. The closest I could find was this obscure advice on qc-dev:

"In QC you need to move the world inversely to your desired camera move and the sprites you wish to keep facing the camera inversely to your world's rotation."

The poster clarified with an attached .qtz but for some reason I can't download the attachment. The original post is at:

http://lists.apple.com/archives/quartzcomposer-dev/2008/Sep/msg00077.html

If anyone can help with the sprite/billboard issue I would appreciate it.

thanks! Bruno

Comment viewing options

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

gtoledo3's picture
Re: Sprite which always faces viewer?

A GL Point will always face the camera (eg. "billboard effect) and work in 3 dimensions, but will only get so big, and be kind of arbitrary on different GPUs in performance and/or look.

It sounds like your best bet is to investigate using the Sprite, like you desire, and placing it in 3d transforms, trackballs, etc., and then using the Kineme GL Tools "GL Inverse Rotation" patch, connected to the rotation inputs on your Sprite. This will provide inverse rotation values to the Sprite, making it seems as though it always billboards.

PreviewAttachmentSize
inverse rotation demo.qtz3.56 KB

cybero's picture
Re: Sprite which always faces viewer?

& just for completeness' sake - here's that composition you couldn't download from the dev list.

The trick is to "download file as" and save as per it's posted name, not the .bin name you get presented with in the save dialogue box.

If the file then still saves as file.qtz.bin, you just need to rename the file in Finder.

PreviewAttachmentSize
inverse-rotation.qtz6.77 KB

gtoledo3's picture
Re: Sprite which always faces viewer?

For stock scenario, where you're simply "undoing" stuff that one has induced with a 3d transform, yeah, simply multiplying by -1 (or doing extra math if multiple transforms are involved) will work. It won't help if there's a trackball, which is where the GL Tools patch is actually necessary (and not just a way out of not doing math).

I forgot to add that there's a Noise Industries patch that delivers this info as well, but outputs structure, "NI OpenGL Get Matrix Inverse".

lifemusic's picture
Re: Sprite which always faces viewer?

Thanks George, that explains it perfectly. I'll try it out today. I'm not using a trackball, just a single 3D Transform, so the inversion as you explain it should be straightforward.

Cybero, thank you for the file. I've run into this attchment problem on apple-dev before and been stuck. Googling it brings up a lot of irrelevant solutions.

-bruno