CountTriangles Not Working :(
BlitzMax Forums/MiniB3D Module/CountTriangles Not Working :(
| ||
Hello, So i'm trying to count the triangles and clear the surface (leaving the vertexes in place) and then building new Triangles, but every time I go to use it, It's tell me I have to many parameters..?? Method UpdateTriangles(surf:TSurface, x:Int, z:Int) Local tmp:TMesh = CopyMesh(hmesh) ClearSurface surf, False, True For Local s:Int = 1 To CountSurfaces(tmp) Local gs:TSurface= GetSurface(s) For Local t:Int = 0 To CountTriangles(gs)-1 DebugLog t Local v1:Int = TriangleVertex(gs,t,0) Local v2:Int = TriangleVertex(gs,t,1) Local v3:Int = TriangleVertex(gs,t,2) AddTriangle surf, v1, v2, v3 Next Next tmp.FreeEntity() End Method I see nothing different in my code, that I have seen in other codes before. http://www.blitzmax.com/Community/posts.php?topic=91499 BTW here is the post for my game its under b3d newbie, because I wanted a little more help, but I think I need to place it here instead... |
| ||
Compiles for me (although in my test code I converted the method to a function (because you didn't provide the full Type), "hmesh" referenced a cube created via CreateCube() and the line:Local gs:TSurface = GetSurface(s) had to be changed to Local gs:TSurface = GetSurface(tmp, s) What line does the debugger highlight when it returns the too many params error? |
| ||
Sorry, I got it, I was using it in a type the extends the TMesh, and it cause some weird things, I fixed it though.. |