Problem with SegmentsExtrude

Software: Away3D 3.x

mduhagon, Newbie
Posted: 10 April 2012 03:30 PM   Total Posts: 4

Hello,

I’m using SegmentsExtrude to build a line graph.

Each point in the line graph is a point for the SegmentsExtrude class.

I thought this was working ok, but SegmentsExtrude seems to be having problem with some values.

The problem seems to be that SegmentsExtrude doesn’t like it when I give it points that are all intermediate points of the same line.

For example, if I try to graph the values 150, 160, and 170, wich would result in a straight line up,  the the render get’s really slow, (I get actionscript timeout errors with a few more points), and the x position for the points in the extrude seem to be wrong (far to the left instead of where I wanted it)

If i graph the values 150, 160, and 180, not a straight line anymore, then performance is good, x position of each point as expected, etc.

This is my first time using this class, and also away3d, maybe someone who knows this class better could explain why I could be having this problem? And if there’s any sort of workaround?

Also, I notice that away3d version 3.6 does not include SegmentsExtrude anymore, which extruder class can I use as a substitute?

   

Avatar
Fabrice Closier, Administrator
Posted: 10 April 2012 03:44 PM   Total Posts: 1265   [ # 1 ]

Which version of the engine are you running? 3.5?

   

mduhagon, Newbie
Posted: 10 April 2012 04:25 PM   Total Posts: 4   [ # 2 ]

I am not sure, the away3d library I had was inherited from a previous project. Is there a way to guess the version from the source files?
It was targetting flash player 9, so I think it’s an old version

   

Avatar
Fabrice Closier, Administrator
Posted: 10 April 2012 08:03 PM   Total Posts: 1265   [ # 3 ]

can you post some url with both cases+ your code snippet please.
Right click on any Object3D should display the context menu with the away version

   

mduhagon, Newbie
Posted: 10 April 2012 10:00 PM   Total Posts: 4   [ # 4 ]

great tip about the right click, didnt know about that. The Away3d version I am using is 2.3.3

Here’s the url with problematic case:

http://dl.dropbox.com/u/16932386/lineGraph/index2.html

if you click on the graph and drag you can pan the chart. Notice the poor performance, and the fact that the line is starting way off to the left (wrong)

The values I tried to graph here where 150, 160, 170, 180

Here the url with no problems:

http://dl.dropbox.com/u/16932386/lineGraph/index3.html

The same code, but now I graph these values: 150, 180, 180, 190

Notice how better performance is, and the line is inside the chart as expected, no problem with the x axis position of things.


My code is spread across many classes and has more logic, but I tried to extract the snippet that calls the SegmentExtrude.

Faulty case:

lineGraphPoints = new Array();
 
lineGraphPoints.push(new Number3D(600, 292.5, 0));
lineGraphPoints.push(new Number3D(360, 333, 0));
lineGraphPoints.push(new Number3D(120, 373.5, 0));
lineGraphPoints.push(new Number3D(-120, 414, 0));
lineGraphPoints.push(new Number3D(-360, 454.5, 0));
 
 
var lineGraphExtrude:SegmentsExtrude = new SegmentsExtrude(lineGraphPoints,                {materials: {front:m,          back: m,            left:new ColorMaterial(lineFrontColor),              right: new ColorMaterial(lineFrontColor),          top: new ColorMaterial(lineFrontColor)},
coverall:true,              axis:“z”,                offset:50,            subdivision:1,
scaling:1,
thickness_subdivision:1,
flip:false,
thickness:8,
bothsides:true,
recenter:true,
omit:”“});

OK Case:

lineGraphPoints = new Array();
 
lineGraphPoints.push(new Number3D(600, 292.5, 0));
lineGraphPoints.push(new Number3D(360, 333, 0));
lineGraphPoints.push(new Number3D(120, 414, 0)); // THIS LINE CHANGES!
lineGraphPoints.push(new Number3D(-120, 414, 0));
lineGraphPoints.push(new Number3D(-360, 454.5, 0));
 
 
var lineGraphExtrude:SegmentsExtrude = new SegmentsExtrude(lineGraphPoints,                {materials: {front:m,          back: m,            left:new ColorMaterial(lineFrontColor),              right: new ColorMaterial(lineFrontColor),          top: new ColorMaterial(lineFrontColor)},
coverall:true,              axis:“z”,                offset:50,            subdivision:1,
scaling:1,
thickness_subdivision:1,
flip:false,
thickness:8,
bothsides:true,
recenter:true,
omit:”“});

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X