Silverlight 5 RC

Sep 23, 2011 at 7:32 PM

Has anyone had any luck running the Babylon.Toolkit.Sample project with the Silverlight 5 RC?  I get out of range exception on the

           modelMesh.Device.DrawIndexedPrimitives(PrimitiveType.TriangleList, VerticesOffset, MinVertexIndex, NumVertices, IndicesOffset + StartIndex, PrimitivesCount);

line of code.


Just wondering...





Sep 26, 2011 at 11:22 AM

No luck so far... It seems that it is the numVertices parameter that is out of bounds all of a sudden, and I haven't found a consistent way to solve it. For simpler models you could just replace the 'numVertices' value with 'numVertices / 3' or even just '1', but that doesn't work for the spaceship model. I'm hoping that the David Catuhe has time to look at it soon, since I assume he has the deepest insight into the toolkit. I suppose it may also be a newly introduced bug in Silverligt itself, since the parameters that Babylon sends to the DrawIndexedPrimitives method seem to make sense...


Daniel Persson

Sep 26, 2011 at 11:56 AM

Hi guys,

We are currently working on the new version of Silverlight 5 Toolkit and we are almost done

Stay tuned!

Oct 6, 2011 at 2:13 PM
Edited Oct 7, 2011 at 9:21 AM

Hi Im also trying to solve this issue, but unfortunately with no success. Im wondering, what the value numVertices really is for. Documentation says : Number of vertices used during the call. The first vertex is located at index: baseVertex + minVertexIndex. So if I understand well, than this number should be same as number of Indices. In SL 5 beta it worked like this...

I tried to render cube, (cube has 8 vertices, 12 triangles). If I want to draw cube i have to draw 12 triangles => 12*3 vertices...

 But  DrawIndexedPrimitives dont accept this value, and draws cube well if numVertices is 24... Dont really know where is this number from ... ??? Im really thinking about some bug in SL5 RC.

I also tried sphere and other primitives, but no succes again and method worked well with numVertices= Indices/6 for sphere.



Nov 20, 2011 at 3:41 AM
Edited Nov 20, 2011 at 3:42 AM

I solved the problem: when calling importer.ImportAsync, pass the third parameter as ImportationOptions.None.  If you pass ImportationOptions.Optimize, you will see the crash.

I hope the new Babylon Toolkit would fix the bug.