I'm extending Pass to make some special drawing.
In doRender, how can I take a Spatial, draw it, make a change to it and draw it again?
I tried doing this f.ex.
public void doRender(Renderer r) {
Node node;
for (int j = 0; j < spatials.size(); j++) {
if (spatials.get(j) instanceof Node) {
node = (Node) spatials.get(j);
for (int i = 0; i < node.getQuantity(); i++) {
TriMesh mesh = null;
if(node.getChild(i) instanceof TriMesh){
mesh = (TriMesh)node.getChild(i);
scaleVertexBuffer(mesh.getVertexBuffer(), 2f);
mesh.draw(r);
scaleVertexBuffer(mesh.getVertexBuffer(), 0.5f);
mesh.draw(r);
}
}
}
}
}
From this I expect to see a small version of the meshes drawn on top of itself, but all I see is the small version.