Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Circle?



Thanks for that suggestion! Hadn't thought of that...

I'm also replying to myself; I figured out how to act without source material. The function I had missed in the reference material was destCoord (). Here is some code generating a circle centered around (0,0):

kernel vec4 circle ()
{
    vec4 v = destCoord ();
    float c = ( sqrt ( v.x*v.x + v.y*v.y ) < 300. ? 0. : 1. );
    return vec4 ( c, c, c, 1.0 );;
}

/ David

On 7 maj 2005, at 21.02, Scott Ahten wrote:

How about an flat (un-lit) sphere?

On May 7, 2005, at 2:43 PM, David Remahl wrote:


Can you think of a good way to create an image containing a circle? I'm surprised there isn't an Image Unit for creating simple geometrical shapes (yet)...

I'd like to avoid to embed a bitmap in the composition for such a simple thing. I can think of a number of ugly ways of generating it procedurally (involving iterators), but none of them is going to be very efficient. I also tried to create it using a • (bullet) using Image from String, but cropping it accurately turned out to be difficult.

I've decided that writing a CIKernel to do it is probably the Right Thing™ to do. However, I ran into problems immediately. I have virtually no familiarity with OpenGL Shading Language, and the examples I found all acted on source material and did not work as generators...

Is there any sample code available for writing generator-cikernels?

/ David
_______________________________________________
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: 
 >Circle? (From: David Remahl <email@hidden>)



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.