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 14:50:59 -0400
On Oct 25, 2009, at 2:42 PM, Matthias Arndt wrote:
My code draws lines some thousand times with different angles. I'd
like to have the lines to look similar to 3D objects. So currently I
draw each line segment three times:
1. one time with a thick line in black
2. the second time with a slightly thinner line in the current color
3. and a third time with a very thin white line (some kind of
highlighting)
How about creating 1 NSGradient instance for each color you want,
then creating one bezier path for each line. The path would describe
the outer edges of the pipe, then you'd *fill* it with the gradient at
the desired angle, rather than stroking.
If you need better performance than that, you should seriously
consider OpenGL. In fact, you should be kind to your users' batteries
and processor loads (you *are* considering laptops, aren't you?) and
consider OpenGL anyway. It'd make quick and light work of this by
comparison ...
--
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