Isn't there a sample in the 3dgs folder which does exsactly that?