I cant seem to get Mesh.SetPointSize() working…
Am I doing it correct? (it does seem to make the change to 10f, as i see the larger points, but it reverts immediatly back to the default as if by magic!)
Kind regards,
Chris
pre type="java"
Vector3f p0 = new Vector3f(0, 0, 0);
Vector3f p1 = new Vector3f(1, 0, 0);
Vector3f p2 = new Vector3f(0, 1, 0);
FloatBuffer vertices = BufferUtils.createFloatBuffer(p0, p1, p2);
Vector3f n0 = new Triangle(p0, p1, p2).getNormal();
FloatBuffer normals = BufferUtils.createFloatBuffer(n0, n0, n0);
IntBuffer indices = BufferUtils.createIntBuffer(0, 1, 2);
FloatBuffer size = BufferUtils.createFloatBuffer(10f, 10f, 10f);
Mesh mesh = new Mesh();
mesh.setMode(Mesh.Mode.Points);
mesh.setBuffer(VertexBuffer.Type.Position, 3, vertices);
mesh.setBuffer(VertexBuffer.Type.Normal, 3, normals);
mesh.setBuffer(VertexBuffer.Type.Index, 1, indices);
mesh.setBuffer(VertexBuffer.Type.Size, 1, size);
Material material = assetManager.loadMaterial("/Common/Materials/RedColor.j3m");
Geometry geometry = new Geometry(“GeoPoints”);
geometry.setMaterial(material);
geometry.setMesh(mesh);
mesh.setPointSize(10f);
mesh.updateBound();
mesh.updateCounts();
this.rootNode.attachChild(geometry);
/pre
Adding this into simpleupdate()…
System.out.println("POINT SIZE: " + mesh.getPointSize());
returns the correct value of 10f…