Different types of lines.

Software: Away3D 4.x

Hector, Sr. Member
Posted: 17 December 2013 08:33 PM   Total Posts: 137

Hi,

I work in educational projects and it would be nice to draw and modify 3D lines with arrowheads. Something like Powerpoint lines.
Also dashed and dotted lines would be great.
Maybe implemented in SegmentSet or PathExtrude object types.

Thanks for the hard work. I love Away3D.

Please support or subscribe to this request if you think it’s useful.

   

Avatar
Fabrice Closier, Administrator
Posted: 17 December 2013 10:11 PM   Total Posts: 1265   [ # 1 ]

I wrote a class for this a while ago, it’s in the older 3.x repo in primitives “Arrow.as”. Porting it should not be a biggy especially if you look at the other primitives code. Tho, some extra polys on the tail should be added and may be some extra vertices&normals; too, to ensure nice results if lighted in 4.x. It is also uv mapped, and comes with thickness option. So you could simulate dots & dashes or whatever using a repeat.
Unlike the segments it would however scale depending on camera distance like any other meshes.

   

Hector, Sr. Member
Posted: 21 December 2013 09:42 PM   Total Posts: 137   [ # 2 ]

Thanks for your help Fabrice,

I have looked at “Arrow.as”. Unfortunately, it would only work for straight lines.
The user has to be able to draw and modify curved lines on the 3D plane using the mouse. Same than ‘Scribble’ lines in Word or ‘Freeform Shapes’ in PowerPoint.

I made the code for v3.6, using a combination of Segment and PathExtrusion. The user draws the 3D line (with Segments); Then, on Mouse Up, the segments are converted to an extruded line with arrowheads.
It may be a bit complex, but I get a good drawing and modifying speed in Flash10.

Before messing with the big task of porting my old code to v4, I was wondering if there would be something in this new version of Away3D to allow users to draw 3D lines dynamically and to make my life easier smile

   

Avatar
Fabrice Closier, Administrator
Posted: 21 December 2013 10:56 PM   Total Posts: 1265   [ # 3 ]

unfortunatly, adobe did not gave us primitives, so no dots no lines for stage3D api. To make these you have to go thru all kinds of geometry constructs and/or projection. The segments similar to 3.x are in 4.0 but not as curved lines. You’ll have to calculate a distribution/subdivision of points on a bezier line and use these to add more segments. SegmentSet was limited to a max buffer, so i’ve added support for multiple buffers a few months back. You do not have to worry about running out of buffer, you can have like (196k x 256) /11 segments on screen before you hit a resource limit. You will have, for a curve, to keep track of each segments composing it, in order to update or remove them.

Another option is to build a new entity “arrow” and build something similar as segmentSet to handle and generate the kind of graphics that you need, but this means you are familar with agal, writing shaders, the stage3D api.

   

Hector, Sr. Member
Posted: 23 December 2013 09:53 AM   Total Posts: 137   [ # 4 ]

Thanks for your help Fabrice, I will have a go with SegmentSet as it seems similar to 3.x.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X