Like this article? We recommend
Loading the World
First, you need to load the world from the M3G file. In pogoroo.m3g, you see a kangaroo jumping on a pogo stick and a green field in which the kangaroo moves. Listing 1 loads the Loader classes load() methods.
Listing 1. Loading the world
try { // load the world from the M3D file myWorld = (World)Loader.load("/pogoroo.m3g")[0]; getObjects(); setupAspectRatio(); } catch(Exception e) { e.printStackTrace(); }