Mucking about with some mesh smoothing algorithms, I need to tessellate a mesh.
I’m trying with FaceHelper, but I always get an Error after the operation.
private function tessellateMesh(evt:Event):void {
// pause rendering
pauseRenderer();
console.text = "Triangles before tesselation: " + String(_mesh.geometry.subGeometries[0].numTriangles);
// tessellate
FaceHelper.triFaces(_mesh);
console.text += "nTriangles after tesselation: " + _mesh.geometry.subGeometries[0].numTriangles;
}
The tessellate button calls the above function.
http://www.videometry.net/broomstick/faces/ModelBrowser.html
You can see in the text field that the tessellation completes successfully, but if you press “play” to re-start the rendering loop, you get the following error.
RangeError: Error #3669: Bad input size.
at flash.display3D::VertexBuffer3D/uploadFromVector()
at away3d.core.base::SubGeometry/getVertexNormalBuffer()
at away3d.core.base::SubMesh/getVertexNormalBuffer()
at away3d.materials.passes::DefaultScreenPass/render()
at away3d.materials::MaterialBase/renderPass()
at away3d.core.render::DefaultRenderer/drawRenderables()
at away3d.core.render::DefaultRenderer/draw()
at away3d.core.render::RendererBase/executeRender()
at away3d.core.render::RendererBase/render()
at away3d.containers::View3D/render()
at ModelBrowser/handleEnterFrame()
I’m assuming it’s some buffer that doesn’t get reset, or similar.
Is there another command you have to use on a mesh after it’s been through a Face splitting operation? I have tried a few things but without success.
Should I log this as a bug?
Cheers!