Make a solid line look like 3D
Make a solid line look like 3D
- Subject: Make a solid line look like 3D
- From: Matthias Arndt <email@hidden>
- Date: Sun, 25 Oct 2009 19:42:17 +0100
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)
Then the same for the next line segment.
The visual effect is exactly as I wanted (example at [1]), but the
performance isn't: As ever line is drawn three times with a different
NSBezierPath, the view's drawRect: includes the following code for
ever stitch three times:
[blackLine removeAllPoints];
[blackLine moveToPoint:oldPoint];
[blackLine lineToPoint:newPoint];
[[NSColor blackColor] set];
[blackLine stroke];
This results in a significant lack while scrolling, zooming etc.
Isn't there any way to use e. g. gradients for solid (thick) lines to
make them look like a pipe? Or do you have any other suggestions?
Matthias
[1] <http://www.stitchbuddy.de/StitchBuddy-EN/StitchBuddy_files/IMG_StitchBuddy_Rotate_EN.jpg
>
_______________________________________________
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