as Frederik found out there are problems when using the Canvas if you don't use exactly the same procedure as it is used in the GUI.
Basic problem is, that the Canvas has to get a reference of the component it is added to. This reference wil be used to remove and and add the Canvas again when switching between anaglyph-mode and normal mode. If you add the Canvas to a component, which does not yet have any size (e.g. was not added to another component)), then the offlinecanvas have a size of (0,0) and you won't see anything.
To overcome this problem look how it is done in the GUI (add the components, instantiate the canvas and then add the canvas to the components).
already started a way to overcome many issues by using a panel (still not used, should be completed sometime):
don't allow to instantiate the canvas itself, but only a special panel. internally the canvas can then be removed an added at own will, because we control the layout of the panel.
would get rid of the parent-parameter and the size issue frederik has found be using an ancestorlistener