Pie Charts - Lathe Extrusion

Software: Away3D 3.x

achim, Newbie
Posted: 22 June 2011 03:00 AM   Total Posts: 20

Hi,
how would you guys proceed to slice a cylinder like this example ?
Maybe the Cylinder primitive is not a good starting point for that ?
Thanks…

   

achim, Newbie
Posted: 23 June 2011 10:33 AM   Total Posts: 20   [ # 1 ]

I’ve found that Lathe Extrusion is a good way to build my Pie Chart. But, if I can set the angle value of each part through the parameter “revolutions” :

this._pie1=new LatheExtrusion(aPoints,{axis"y"revolutions.7subdivision72scale2,offsetRadius:70});
   
this._pie2=new LatheExtrusion(aPoints,{axis"y"revolutions.3subdivision72scale2,offsetRadius:70}); 

I don’t know how to modify it later…


Can anyone help ?
Thanks.

Here you can see what I’ve done so far : circular Chart

   

achim, Newbie
Posted: 24 June 2011 08:50 PM   Total Posts: 20   [ # 2 ]

Maybe LatheExtrusion is not the best class to do this ? What do you think ? I am stuck, there…

   

achim, Newbie
Posted: 30 June 2011 03:09 PM   Total Posts: 20   [ # 3 ]

problem seems to be in the view.render();

TypeErrorError #1009: Cannot access a property or method of a null object reference.
 
at away3d.extrusions::LatheExtrusion/generate()[/Users/myDir/Desktop/dir/dev/src/away3d/extrusions/LatheExtrusion.as:226]
 at away3d
.extrusions::LatheExtrusion/buildPrimitive()[/Users/myDir/Desktop/dir/dev/src/away3d/extrusions/LatheExtrusion.as:652]
 at away3d
.primitives::AbstractPrimitive/updatePrimitive()[/Users/myDir/Desktop/dir/dev/src/away3d/primitives/AbstractPrimitive.as:101]
 at away3d
.primitives::AbstractPrimitive/get geometry()[/Users/myDir/Desktop/dir/dev/src/away3d/primitives/AbstractPrimitive.as:204]
 at away3d
.core.base::Mesh/updateMesh()[/Users/myDir/Desktop/dir/dev/src/away3d/core/base/Mesh.as:565]
 at away3d
.core.traverse::ProjectionTraverser/apply()[/Users/myDir/Desktop/dir/dev/src/away3d/core/traverse/ProjectionTraverser.as:120]
 at away3d
.core.base::Object3D/traverse()[/Users/myDir/Desktop/dir/dev/src/away3d/core/base/Object3D.as:1543]
 at away3d
.containers::ObjectContainer3D/traverse()[/Users/myDir/Desktop/dir/dev/src/away3d/containers/ObjectContainer3D.as:358]
 at away3d
.containers::View3D/render()[/Users/myDir/Desktop/dir/dev/src/away3d/containers/View3D.as:775]
 at fr
.myDir.charts.charts3D.circularDiagrams::circularDiagram/renderThis()[/Users/myDir/Desktop/dir/dev/src/FLAs/../fr/myDir/charts/charts3D/circularDiagrams/circularDiagram.as:90] 

line 90 is where is called on ENTER_FRAME view.render().

   

Avatar
Fabrice Closier, Administrator
Posted: 30 June 2011 03:29 PM   Total Posts: 1265   [ # 4 ]

I have added a Lathe demo class in Broomstick. if you run it, one of the displayed examples on screen is a Pie chart.

I see you use 3.x, but it should be similar codewize for 3.x and even 2.x.

   

achim, Newbie
Posted: 01 July 2011 08:43 AM   Total Posts: 20   [ # 5 ]

Thanks a lot.
I’ve downlaoded Broomstick, but I cannot find your Lathe class ? Is it in the svn only ?

   

Avatar
Fabrice Closier, Administrator
Posted: 01 July 2011 08:52 AM   Total Posts: 1265   [ # 6 ]

in git & svn.—> extrusions.LatheExtrude.as
The example class is in examples.away3d.as.src package—> LatheExtrudeTest.as

   

achim, Newbie
Posted: 01 July 2011 01:22 PM   Total Posts: 20   [ # 7 ]

Thanks again.
What I have done in my test is almost similar to your example code, at least in the way I build my pie elements.
However, what I want to achieve is to be able to modify the proportional size of my pie pieces relatively to the overall value…
Trying to pass another value to the parameter “revolutions” gives me the error I pasted in a precedent post.
(btw, in LatheExtrude.as, line 161, the code is

_revolutions = (_revolutions>.001)? _revolutions .001;
_revolutions val

Shouldn’t it be

_revolutions val;
_revolutions = (_revolutions>.001)? _revolutions .001

 

   

Avatar
Fabrice Closier, Administrator
Posted: 01 July 2011 01:30 PM   Total Posts: 1265   [ # 8 ]

Actually it should be _revolutions = (val>.001)? val : .001;

Will correct asap

   

achim, Newbie
Posted: 01 July 2011 02:23 PM   Total Posts: 20   [ # 9 ]

(didn’t mean to be intrusive)

   

achim, Newbie
Posted: 05 July 2011 09:56 PM   Total Posts: 20   [ # 10 ]

I’ve investigated the code a bit, and I haven’t found anything so far that’d let me think there’s a hope to be able to change the size of my pie pieces with LatheExtrusion? (but, again, I’m totally noob regardingAway3D…)
What kind of primitive would you advise me to use to get a 3D shape that could be “morphable”?
Thanks!

   

mcglynn, Newbie
Posted: 26 September 2011 12:07 AM   Total Posts: 1   [ # 11 ]

I have just started playing around with Away3D, and wrote a basic “Wedge” primitive that can be used to create a pie chart.  I posted a sample at http://www.mikemcglynn.com/blog/?p=229

   

Tareq Battat, Newbie
Posted: 29 March 2012 10:47 PM   Total Posts: 5   [ # 12 ]
Fabrice Closier - 01 July 2011 08:52 AM

in git & svn.—> extrusions.LatheExtrude.as
The example class is in examples.away3d.as.src package—> LatheExtrudeTest.as

Please guys I have facing the same problem when I trying to change the revolutions value of extrusion after adding my pie chart to scene, I use version 3.6 can anybody help solving these like issue, and we will thanks him a lot.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X