Re: Make a solid line look like 3D
Re: Make a solid line look like 3D
- Subject: Re: Make a solid line look like 3D
- From: "I. Savant" <email@hidden>
- Date: Sun, 25 Oct 2009 18:05:18 -0400
On Oct 25, 2009, at 5:44 PM, Matthias Arndt wrote:
Thanks for your response. I'm nearly convinced to look into the
gradients tomorrow, although I'm afraid it won't result in a better
performance: Empty the path, calculate the angle, create the rect
(with rounded edges), apply the gradient and fill the path ... vs.
three move to / line to ... I'll see.
A few points:
1 - You're guessing regarding the performance. Measure, then decide.
2 - Less work is automatically better performance (ie, 1 path is
better than 3).
3 - I have no idea what you mean by "empty the path" ... do you mean
release it and create a new one, assigning it to your
"currentPath" (or whatever) pointer? If so, see point 2.
4 - You're calculating the angle for your current approach anyway,
aren't you?
OpenGL to make some basic lines look somehow three-dimensional?
Isn't that over-kill? Sorry for my ignorance, I haven't coded
OpenGL, yet, and I am a bit reluctant to add it to my (already long)
todo list for this project ... But it would be interesting ... I'll
have to make up my mind :-)
Again, you're guessing. You *did* indicate a desire for better
performance than your current approach, right? It's in your best
interest to at least investigate OpenGL since it was suggested. A few
minutes with Google can do wonders.
OpenGL does just as well (better?) with 2D objects. It's
exceptional at creating them and filling them with gradients.
Ridiculously better than the high-level Cocoa drawing mechanisms could
ever hope to be.
Further, since you said you're making a screen saver, that's even
more of an argument for OpenGL. I've downloaded, tried, and
immediately deleted many screen savers because they immediately
started heating up my laptop and draining its battery because of how
poorly they performed. Be kind to your users or they'll ditch you
quickly.
Finally, you don't necessarily have to know the "nitty-gritty" of
OpenGL. Quartz Composer (part of Xcode Tools) would make this task
easy with just a few hours of effort spent learning how to use it.
Depending on what you're doing, you might even get away with *zero
code* if you create a composition that accepts your preferences as
inputs into the patches you create, using bindings to connect
everything.
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden