Hi everybody:
I got a problem that lwjgl.GL11.glPointSize() works fine in 3.1 but doesn’t do anything in 3.2. Can anybody teach me what to do to change point size or what have been changed in JME?
Details are :
1 to test basic game functions in a faster way I build a new mesh class tPoint witch only display a single point (still learning mesh class so there could be errors ) :
import com.jme3.export.InputCapsule;
import com.jme3.export.JmeExporter;
import com.jme3.export.JmeImporter;
import com.jme3.export.OutputCapsule;
import com.jme3.math.Vector3f;
import com.jme3.scene.Mesh;
import com.jme3.scene.VertexBuffer;
import com.jme3.scene.VertexBuffer.Type;
import java.io.IOException;
import java.nio.FloatBuffer;
public class tPiont extends Mesh {
private Vector3f start;
public tPiont(Vector3f start) {
setMode(Mode.Points);
updateGeometry(start);
}
protected void updateGeometry(Vector3f start) {
this.start = start;
setBuffer(Type.Position, 3, new float[]{start.x, start.y, start.z});
setBuffer(Type.TexCoord, 2, new float[]{0, 0});
setBuffer(Type.Normal, 3, new float[]{0, 0, 1 });
setBuffer(Type.Index, 1, new short[]{0});
updateBound();
}
/**
* Update the start and end points of the line.
*/
public void updatePoints(Vector3f start) {
VertexBuffer posBuf = getBuffer(Type.Position);
FloatBuffer fb = (FloatBuffer) posBuf.getData();
fb.rewind();
fb.put(start.x).put(start.y).put(start.z);
posBuf.updateData(fb);
updateBound();
}
public Vector3f getStart() {
return start;
}
@Override
public void write(JmeExporter ex) throws IOException {
super.write(ex);
OutputCapsule out = ex.getCapsule(this);
out.write(start, "startVertex", null);
}
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule in = im.getCapsule(this);
start = (Vector3f) in.readSavable("startVertex", null);
}
}
2 I used GL11.glPointSize() to change size of these points
3 It works well in 3.1 but do nothing in 3.2 stable