Reputation: 8606
is there a straightforward way to draw 3d lines with graphics.lineTo()/moveTo()? I havent run into anytihng. both of these methods only use x/y for their coordinates.
Im using the 'z' coordinate on my sprites and want to connect them with lines... help is appreciated
Upvotes: 3
Views: 1778
Reputation: 4468
The graphics class only works with 2D coordinates. However, you can still do what you want in a number of ways. The easiest is to place empty sprites inside of your main sprites where you want your lines to connect. Then just loop over those points and use the localToGlobal local3DToGlobal method to transform their coordinates to stage coordinates. Then just draw lines between those coordinates. Flash will handle the projection for you when you use localToGlobal local3DToGlobal. The only thing you're going to have to worry about is Z-sorting of the lines.
Upvotes: 5