[SOLVED] How can you vertex paint terrain


#1

How can you vertex paint a TerrainQuad?(or any spatial for that matter)

I have a use case where i cannot load a particular texture for my terrain, and it would be plain unhelpful. I have a map of colors for all the vertices of the terrain. How would I go about applying them?
If I need the seperate meshes, I can get them using this:

    public static List<Geometry> getMeshes(Node node) {
        List<Mesh> meshes = new ArrayList();
        for (Spatial s : node.getChildren()) {
            if (s instanceof Node) {
                meshes.addAll(getMeshes((Node) s));
            } else if (s instanceof Geometry) {
                meshess.add(((Geometry) s).getMesh());
            }
        }
        return meshes;
    }

#2

is there something the documentation doesn’t explain?

https://wiki.jmonkeyengine.org/jme3/advanced/custom_meshes.html#example-vertex-colors


#3

Thank you, I didn’t check that part of the documentation.


#4

Please don’t mistake my question for arrogance; the wiki is very much community driven, and sometimes things may be missed due to oversight or assumption. It’s always best to ask :slight_smile:


#5

I wont, thanks though, it probably would’ve taken me a week or two to find that :blush:


#6

At the top of each wiki page there is a search box that will search the entire wiki for you.

The link provided by jayfella is the very first link to appear when entering the word vertex…