@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setNonARRenderer(new LightingRenderer()); res = getResources(); artoolkit = getArtoolkit(); getSurfaceView().getHolder().addCallback(this); }
@Override public void surfaceCreated(SurfaceHolder holder) { super.surfaceCreated(holder); // load the model // this is done here, to assure the surface was already created, so that the preview can be // started // after loading the model if (model == null) { waitDialog = ProgressDialog.show(this, "", "loading...", true); waitDialog.show(); new ModelLoader().execute(); } }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // setContentView(R.layout.activity_custom); CustomRenderer renderer = new CustomRenderer(); super.setNonARRenderer(renderer); try { artoolkit = super.getArtoolkit(); someObject = new CustomObject( "Cubo1", "patt.hiro", 80.0, new double[] {0, 0}, new float[] {0f, 1.0f, 0f, 0.0f}); // Verde artoolkit.registerARObject(someObject); someObject = new CustomObject( "Cubo2", "android.patt", 80.0, new double[] {0, 0}, new float[] {0f, 1.0f, 2.0f, 0.0f}); // Azul artoolkit.registerARObject(someObject); someObject = new CustomObject( "Cubo3", "barcode.patt", 80.0, new double[] {0, 0}, new float[] {1.0f, 0.0f, 0.0f, 0f}); // Vermelho artoolkit.registerARObject(someObject); } catch (Exception e) { e.printStackTrace(); } }