Drawing a lot of single triangles

Software: Away3D 4.x

er453r, Newbie
Posted: 30 September 2011 07:47 PM   Total Posts: 5

Hi. I’m using a method described here http://away3d.com/forum/viewthread/877/ to draw triangles. Unfortunately after adding about a 1000 triangles I get the:

ErrorError #3691: Resource limit for this resource type exceeded.
 
at flash.display3D::Context3D/createVertexBuffer() 

And all triangles share the same material.

I’m just starting with 3d, so I know I’m doing something wrong. Molehill can handle a lot more polygons. How can I do something like this?

I’m trying to generate a simple terrain with marching cubes, and I need only one material for the whole terrain. Please post some hints….

   

er453r, Newbie
Posted: 30 September 2011 08:33 PM   Total Posts: 5   [ # 1 ]

Ok. Solved with mesh merge smile

   

Avatar
Dan Baughman, Newbie
Posted: 22 January 2012 04:37 AM   Total Posts: 5   [ # 2 ]

Hello! I’m running into the same problem… I see you were able to find a solution w/o any help, but would you be so kind as to explain how you used the Merge class on your triangles? I can’t seem to figure it out.
I crash somewhere around 1280 triangle (assuming the .removeChild is not clearing anything from the “vertex buffer”).

   

er453r, Newbie
Posted: 22 January 2012 10:32 AM   Total Posts: 5   [ # 3 ]

Hi. In a loop I’m creating triangles in I use this code:

if(meshes.length 1000){     
 
var mergedMesh:Mesh merge.applyToMeshes(meshes[0]meshes);
     
 
meshes = new Vector.<Mesh>();
      
 
mergedMesh.material material;
 
 
view.scene.addChild(mergedMesh);    

merge is a Merge object (away3d.tools.Merge
)

   

Avatar
Dan Baughman, Newbie
Posted: 22 January 2012 02:29 PM   Total Posts: 5   [ # 4 ]

Hi,
Thank you so much for the prompt reply! I’ll give your code a try. I’m using a class that looks like this:

public class Triangle extends PrimitiveBase 

to generate my triangles. I’m hoping Away considers my Triangles as meshes, if not, I may need to look for another solution.
Again, thanks a million for sharing your code smile

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X