Updating trimesh?

Does anyone know how to update TriMesh on the fly ?

I tried



mesh.getVertexBuffer().put(index,value);





But it only changes it once…next time nothing happens.



Thanks

That's the correct way. Maybe there is another problem?


Perhaps it will work if you add:

mesh.getVBOInfo().setVBOVertexID(-1);
vear said:


Perhaps it will work if you add:

mesh.getVBOInfo().setVBOVertexID(-1);

That did it, thank you !

Any comment on why meshes use float/intbuffers ? It just seems like it's

alot of overhead. And I'd think it doesn't fit very well into most non-jme code

I have some general routines that update meshesm now they dont work without being rewritten.

One would think I'm not the only one with that problem.

I tried to access the array behind the buffers but thats not possible.


It kind of the other way round: arrays would be overhead :slight_smile:

jME uses those buffers because they can be sent to the graphics card via opengl this way. They were converted to and from java arrays in the past - but this caused the data to be held twice thus an application needed about twice as much memory for meshes…

Ahh…Ok now another question. I'm using the new shadow pass.

If you know, how come  shadows are not updated when I use dynamic meshes ?



PS the



mesh.getVBOInfo().setVBOVertexID(-1);



Didnt make any difference anyway i found out. Suddenly it just worked, dont know why.