VertexColor

Hello,



there is a VertexColor MatDef available. How can I use it so that the triangles containing the vertices are color interpolated between them? I want to make a x-y-z plot where z can be a value between [0,1] and mapped to a color range.



Thanks.



Regards,

Qeui

You can apply it like so



[java]spatial.setMaterial(assetManager.loadMaterial(“Common/Materials/VertexColor.j3m”));[/java]

Hello,



thanks for answer. How do I have to set the colors to each vertex? I tried something like…



[java]

ColorRGBA[] colors= new ColorRGBA[vertices.length];

myMesh.setBuffer(Type.Color, 4, BufferUtils.createFloatBuffer(colors));

[/java]



but there is no corresponding method in the BufferUtils class.



Thanks

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:custom_meshes