Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

3d lines in as3 (flash10)

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

like image 600
deepblue Avatar asked Feb 01 '26 10:02

deepblue


1 Answers

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.

like image 159
Branden Hall Avatar answered Feb 03 '26 06:02

Branden Hall