public void setElementComponent(int elementIndex, int componentIndex, Object val) {
        int inPos = elementIndex * components;
        int elementPos = componentIndex;

        if (format == Format.Half) {
            inPos *= 2;
            elementPos *= 2;
        }

        data.clear();

        switch (format) {
            case Byte:
            case UnsignedByte:
            case Half:
                ByteBuffer bin = (ByteBuffer) data;
                bin.put(inPos + elementPos, (Byte) val);
                break;
            case Short:
            case UnsignedShort:
                ShortBuffer sin = (ShortBuffer) data;
                sin.put(inPos + elementPos, (Short) val);
                break;
            case Int:
            case UnsignedInt:
                IntBuffer iin = (IntBuffer) data;
                iin.put(inPos + elementPos, (Integer) val);
                break;
            case Float:
                FloatBuffer fin = (FloatBuffer) data;
                fin.put(inPos + elementPos, (Float) val);
                break;
            default:
                throw new UnsupportedOperationException("Unrecognized buffer format: " + format);
        }
    }
Modify a component inside an element.
The <code>val</code> parameter must be in the buffer's format:
{@link Format}.

@param elementIndex The element index to modify
@param componentIndex The component index to modify
@param val The value to set, either byte, short, int or float depending
on the {@link Format}.
jme3-core/src/main/java/com/jme3/scene/VertexBuffer.java