| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
QC coordinate system is used to position things in the 3D scene:
http://developer.apple.com/documentation/GraphicsImaging/Conceptual/ QuartzComposer/qc_concepts/chapter_2_section_9.html#//apple_ref/doc/ uid/TP40001357-CH202-BCICEEFE
CI coordinate system is only used with CI filters / kernels as they work with images, not the 3D space: it uses pixels with the (0,0) is at the bottom-left corner
Using Image Dimensions, Rendering Destination Dimensions and Math, you can convert from one to the other if necessary: check this composition for example:
/Developer/Examples/Quartz Composer/Interface Builder Compositions/ Mouse Tracking.qtz
and
John Harper wrote:
Core Image has a couple of conceptual coordinate spaces:
Working Coordinates: this is the coordinate system that images exist in, you can think of it as an infinitely large board on which you pin images. Use the -imageByApplyingTransform: method or the CIAffineTransform filter to move images around in this space.
Sampler Coordinates: only seen inside the kernels, each "sampler foo" variable (i.e. each texture when rendering with OpenGL) represents some finite subregion of the infinite working space. Point 0,0 is the bottom left corner of the physical texture, one unit is one texel.
So this means that whenever you use the sample () function in a kernel, the point you specify must be in the coordinate space of that sampler object, not in the working coordinate space (the actual pixels in the texture may be flipped vertically, or have a non-zero translation when rendering tiled, or maybe a weird scale factor if the engine moved an affine transform around)
These are the functions that deal with this:
destCoord () -> the current output point, in the working coordinate space.
samplerTransform (x, p) -> working space point p, mapped into the coordinate space of sampler x
samplerCoord (x) -> the current output point, mapped into the coordinate space of sampler x, equivalent to samplerTransform (x, destCoord ())
If you want to forget all these details, create a new sampling function:
vec4 sampleWorking (sampler x, vec2 p) { return sample (x, samplerTransform (x, p)); }
then just use working space coordinates everywhere.
John
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartzcomposer-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden This email sent to email@hidden
| References: | |
| >Re: Linear image (From: Ralph Brunner <email@hidden>) | |
| >Re: Linear image (From: Sam Kass <email@hidden>) | |
| >Re: Linear image (From: Pierre-Olivier Latour <email@hidden>) | |
| >Re: Linear image (From: John Harper <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.