HelloTriMesh Tutorial

G'day all. I've just discovered jME, and I must say, from the demos available, this looks very promising.

I've been slowly developing a 'game' of sorts with Xith3D in my spare time, but have kind of hit a brick wall, so I'm hoping I can convert and then move on with jME.

But before I begin that, I've started some of the tutorials available here, and have stumbled into a problem, I assume its because of the age of the tutes, and jME has been updated quite a bit since then. Heres my problem:

HelloTriMesh uses the method from TriMesh

reconstruct(com.jme.math.Vector3f[], com.jme.math.Vector3f[], com.jme.renderer.ColorRGBA[], com.jme.math.Vector2f[], int[])

but this appears to have changed to

reconstruct(java.nio.FloatBuffer vertices, java.nio.FloatBuffer normal, java.nio.FloatBuffer color, java.nio.FloatBuffer texture, java.nio.IntBuffer indices)

So my question is this: Is there a quick way to convert an Array of Vector3f's to a FloatBuffer?

Thanks for your help.

Where'd you find that, in the wiki?

This tutorial is up to date in CVS (package jmetest.Tutorial ). In case you're not using CVS yet ot don't want to, you can browse CVS online here and copy the new code for this or any other out of date tutorial:


probably only have to change the broken line and some imports:

 m.reconstruct(BufferUtils.createFloatBuffer(vertexes), BufferUtils.createFloatBuffer(normals),
                BufferUtils.createFloatBuffer(colors), BufferUtils.createFloatBuffer(texCoords), BufferUtils.createIntBuffer(indexes));

Thankyou very much.

I am in fact following the tutorials in the Wiki. I had no idea they were available in the CVS.