3d lines in as3 (flash10)

Is there an easy way to draw 3d lines using graphics.lineTo () / moveTo ()? I do not know how to do that. both of these methods use only x / y for their coordinates.

Im using the 'z' coordinate on my sprites and want to connect them with lines ... help is appreciated

+3
source share
1 answer

The graphics class only works with 2D coordinates. However, you can still do what you want in several ways. The simplest thing is to place empty sprites inside your main sprites where you want your lines to connect. Then simply flip these points and use the localToGlobal local3DToGlobal local method to convert their coordinates to scene coordinates. Then just draw lines between these coordinates. Flash will handle the projection for you when you use localToGlobal local3DToGlobal. The only thing you have to worry about is the Z-sorting of strings.

+5
source

Source: https://habr.com/ru/post/1713872/


All Articles