How to extract vertex position from mesh
and rewrite them? I want to give vertex position like Vector3f[].
It can be through mesh.getBuffer(VertexBuffer.Type.Position) and getData(),
but result not is Vector3f. I wrote a completely wrong code:
Geometry box = new Geometry("Box", new Box(Vector3f.ZERO, 1, 1, 1));
Geometry box1 = new Geometry ();
Mesh boxmesh = new Mesh();
boxmesh = box.getMesh();
VertexBuffer vb = new VertexBuffer();
vb = boxmesh.getBuffer(VertexBuffer.Type.Position);
Buffer buf=vb.getData();
Object array;
array = new Object();
array = buf.array(); // exception
Instead of writing the buffer, read it?
Remember the buffer stores a row of floats and not Vector3f instances. So it’s like (x1, y1, z1, x2, y2, z2, x3, y3, z3, …) instead of (vec1, vec2, vec3), if I remember correctly.