Removing all nodes inside rootNode

Hello,

I was learning about making cartoon edges, and I thought that removing all nodes from rootNode and adding them back in with cartoon edges would be a good way. If this is a good way to have cartoon edges that you can toggle, how do you remove all entities from rootNode? I am using Windows XP, Java 6, and JME3. Thank you!



dangerdoc

In the test example where it creates a CartoonEdgeFilter called ‘toon’, just toggle its ‘enabled’ flag with

[java]

toon.setEnabled(false);

[/java]

That will add/remove the edges without having to have duplicates of every geometry in the scene.

Also, filter post processors work on what is on the screen, so even if you removed the whole scene and added a new one in, as long as the CartoonEdgeFilter is enabled it will give you cartoon edges.

The “makeToonish()” method in the test just sets the material on the objects in the scene, it doesn’t create the actual edges.

1 Like

TestCartoonEdge.java does cartoon edges for you. You do not want to be removing and adding spatials to the root node to achieve an effect.

Hi, Sploreq.

The reason I am asking about removing from rootNode is because I want to be able to toggle the cartoon edge in-game. Is there a way to do this that is different from my idea? I understand what you are saying about removing and adding, but I’m not that experienced with cartoon edges. I might not even understand what you are saying, but I just want an effect that you can toggle in-game. Thank you!



dangerdoc

Thanks Sploreq,

I think that answered all of my cartoon edge questions!



dangerdoc